Home > Back-end >  Relevant DirectoryExists FindFirst function in TService failure problem
Relevant DirectoryExists FindFirst function in TService failure problem

Time:09-26

Discovered in XE7 environment, such as title, the younger brother DirectroyExists, FindFirst function in (TService), such as access network backup drivers disk failure,
A detailed description is as follows:

Found:=findfirst (' \ \ 10.20.30.10 \ Test \ *. * ', faAnyFile, SearchRec);

Also, this sentence in TForm type, no problem, it is failure in TService applications

Or

If DirectoryExists (' Z: \ Test) is this also failed in TSerive type applications, (Z disk is mapped to a network drive \ \ 10.20.30)

Excuse me each GG have encountered the same problem?

CodePudding user response:


Because TSerive is service program, after XP service program is running in the system of a single environment, is not like your Form program running in the current user environment

Under the environment of service, there is no Z disk is mapped to a network drive \ \ 10.20.30.10 \, so should be failed

CodePudding user response:

Service properties, to specify the user (the current mapping a network drive user) run

Or

In service with the specified identity access to the network, as is the function: WNetAddConnection2
  • Related