Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Determine a NT service's executable name ? (http://www.velocityreviews.com/forums/t318796-determine-a-nt-services-executable-name.html)

Harald Schneider 06-24-2003 02:50 PM

Determine a NT service's executable name ?
 
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



Thomas Heller 06-24-2003 02:56 PM

Re: Determine a NT service's executable name ?
 
"Harald Schneider" <h_schneider@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


All times are GMT. The time now is 12:28 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.