NT service working directory

NT service working directory

Post by Houw Su » Wed, 20 Jul 2005 04:48:46


By default, NT service uses system32 dir as the working dir. What's the
right way to change the working dir of a NT service to another desired one?
Given the name of a NT service, what's easiest way to get the directory
where the .exe resides? Please help, thanks!
 
 
 

NT service working directory

Post by Slava M. U » Wed, 20 Jul 2005 05:33:40


GetModuleFileName(0, ...)

S

 
 
 

NT service working directory

Post by Eugene Ger » Wed, 20 Jul 2005 05:39:55


GetModuleFileName(0,...);

from within the service code.

QueryServiceConfig()

from outside


--
Eugene
http://www.yqcomputer.com/
 
 
 

NT service working directory

Post by Houw Su » Thu, 21 Jul 2005 07:51:52

Thank you all!