I'm adapting a program to run as a service, and the first thing it does is open a local configuration file, but it doesn't exist because I don't know what is the current directory.
+3
A:
The current working directory is the location of the executable of the service, unless modified using the win32 API call SetCurrentDirectory
Adam
2009-05-06 21:30:54
A:
Calling GetCurrentDirectory
at the service entry point returns "C:\WINDOWS\system32". After setting it to the executable's directory with SetCurrentDirectory
everything worked as expected.
But, why the system is setting current directoy to windows\system32 initially .. ??
Vadi
2009-12-03 10:48:41