Determine a NT service's executable name ?

Discussion in 'Python' started by Harald Schneider, Jun 24, 2003.

  1. 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
    Harald Schneider, Jun 24, 2003
    #1
    1. Advertising

  2. "Harald Schneider" <> 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
    Thomas Heller, Jun 24, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kaith
    Replies:
    2
    Views:
    423
    Sandip Chitale
    Aug 16, 2003
  2. Replies:
    15
    Views:
    478
    Dave Thompson
    Aug 21, 2006
  3. pratap
    Replies:
    20
    Views:
    750
    Flash Gordon
    Mar 7, 2007
  4. Jason Cavett
    Replies:
    8
    Views:
    609
    Sanjay
    May 16, 2007
  5. Replies:
    0
    Views:
    427
Loading...

Share This Page