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

N

News123

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
 
A

Aahz

News123 said:
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.
 
C

coldpizza

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.
 

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,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top