How to use python to register a service (an existing .exe file)

Discussion in 'Python' started by News123, Feb 16, 2010.

  1. News123

    News123 Guest

    Hi,

    Is there a python way to register new windows services.


    I am aware of the
    instsrv.exe program, which can be used to install services.
    I could use subprocess.Popen to call


    instsrv.exe "service_name" program.exe


    but wondered, whether there's already an existing function.

    Thans in advance and bye


    N
     
    News123, Feb 16, 2010
    #1
    1. Advertising

  2. News123

    Aahz Guest

    In article <4b79e28c$0$4610$>,
    News123 <> wrote:

    >Is there a python way to register new windows services.
    >
    >I am aware of the
    >instsrv.exe program, which can be used to install services.
    >I could use subprocess.Popen to call
    >
    >instsrv.exe "service_name" program.exe
    >
    >but wondered, whether there's already an existing function.


    Use the win32 package.
    --
    Aahz () <*> http://www.pythoncraft.com/

    "At Resolver we've found it useful to short-circuit any doubt and just
    refer to comments in code as 'lies'. :)"
     
    Aahz, Feb 20, 2010
    #2
    1. Advertising

  3. Aahz wrote:
    > In article <4b79e28c$0$4610$>,
    > News123 <> wrote:
    >
    >> Is there a python way to register new windows services.
    >>
    >> I am aware of the
    >> instsrv.exe program, which can be used to install services.
    >> I could use subprocess.Popen to call
    >>
    >> instsrv.exe "service_name" program.exe
    >>
    >> but wondered, whether there's already an existing function.

    >
    > Use the win32 package.


    Indeed, there's some intersting code in this area here:

    http://svn.zope.org/Zope/trunk/src/nt_svcutils/service.py?rev=104819&view=auto

    http://svn.zope.org/Zope/trunk/src/Zope2/Startup/zopectl.py?rev=105396&view=auto

    ....particularly in the do_install function in the latter...

    Chris


    --
    Simplistix - Content Management, Batch Processing & Python Consulting
    - http://www.simplistix.co.uk
     
    Chris Withers, Mar 1, 2010
    #3
  4. News123

    Eman Guest

    On Feb 15, 4:10 pm, News123 <> wrote:
    > Hi,
    >
    > Is there a python way to register new windows services.
    >
    > I am aware of the
    > instsrv.exe program, which can be used to install services.
    > I could use subprocess.Popen to call
    >
    > instsrv.exe "service_name" program.exe
    >
    > but wondered, whether there's already an existing function.
    >
    > Thans in advance and bye
    >
    > N



    Try my favorite 3rd pary tools maker, Chilkatsoft.com.
    http://www.chilkatsoft.com/refdoc/pythonCkServiceRef.html

    Eman_No1
     
    Eman, Mar 2, 2010
    #4
  5. News123

    coldpizza Guest

    instsrv.exe does not come with Windows by default, but I guess it
    should be possible to add a service using the win32 built-in `sc`
    command line tool.

    Try `sc create` from a console.

    The app you want to install as a service will still have to be
    compliant with the win32 service interface, otherwise it will throw an
    error, although the app will still be started.

    On Feb 16, 2:10 am, News123 <> wrote:
    > Hi,
    >
    > Is there a python way to register new windows services.
    >
    > I am aware of the
    > instsrv.exe program, which can be used to install services.
    > I could use subprocess.Popen to call
    >
    > instsrv.exe "service_name" program.exe
    >
    > but wondered, whether there's already an existing function.
    >
    > Thans in advance and bye
    >
    > N
     
    coldpizza, Mar 2, 2010
    #5
    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. nrm
    Replies:
    3
    Views:
    558
  2. ChrisD
    Replies:
    2
    Views:
    2,236
    ChrisD
    Jan 9, 2004
  3. Mike C. Fletcher
    Replies:
    1
    Views:
    292
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Sep 5, 2004
  4. Chaos
    Replies:
    1
    Views:
    423
  5. Replies:
    0
    Views:
    202
Loading...

Share This Page