Determine a NT service's executable name ?

H

Harald Schneider

Hi,

is there a possibility how to determine a services executable file name (and
path) from within the service itself ?

I need to create multiple services of the same application. The app needs to
read a config file, which name depends on the name of the application's
executable itself. So hardcoding it in the registry is no solution ...


--Harald
 
T

Thomas Heller

Harald Schneider said:
Hi,

is there a possibility how to determine a services executable file name (and
path) from within the service itself ?

I need to create multiple services of the same application. The app needs to
read a config file, which name depends on the name of the application's
executable itself. So hardcoding it in the registry is no solution ...

sys.executable (although you should make sure that this returns the
right thing in the py2exe'd file)

win32api.GetModuleFileName(0)

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top