[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

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

News123

2/16/2010 12:11:00 AM

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
4 Answers

aahz

2/20/2010 12:15:00 AM

0

In article <4b79e28c$0$4610$426a74cc@news.free.fr>,
News123 <news123@free.fr> 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 (aahz@pythoncraft.com) <*> http://www.python...

"At Resolver we've found it useful to short-circuit any doubt and just
refer to comments in code as 'lies'. :-)"

Chris Withers

3/1/2010 9:38:00 AM

0

Aahz wrote:
> In article <4b79e28c$0$4610$426a74cc@news.free.fr>,
> News123 <news123@free.fr> 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&...

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

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

Chris


--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simpli...

Eman

3/2/2010 1:48:00 AM

0

On Feb 15, 4:10 pm, News123 <news...@free.fr> 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/pythonCkServi...

Eman_No1

coldpizza

3/2/2010 1:13:00 PM

0

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 <news...@free.fr> 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