By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,485 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,485 IT Pros & Developers. It's quick & easy.

Determine a NT service's executable name ?

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Harald Schneider" <h_*********@marketmix.com> writes:
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
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.