469,916 Members | 1,953 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,916 developers. It's quick & easy.

How do you install a service on MSW?

Hi all

This is not strictly a Python question, but I hope it is not too far
off topic.

The question is 'How do you install a service on MSW?' Here is the
background.

The accounting application I am writing is multi-user. To handle
logins, record locking, etc, I have written a simple socket server
program to keep track of various activities, which must run in the
background all the time. It is written in Python and uses
socket.socket(). It works well.

I need it to work on both Linux and MSW. Up to now I have opened a
separate terminal window, and run it from there. This works fine on
both platforms. Now I want it to run as a true background service.

I have figured out how to do this in Linux. On MSW I naively expected
to be able to go to Control Panel > Adminstrative Tools > Services,
right click, and find an option to add a new service. No such luck.
Can anybody please explain how I might be able to do this, or at least
tell me where I can read up on it.

I am using Python 2.3.3 with Win32 extensions on Windows 2000 Pro.

Thanks in advance

Frank Millman
Jul 18 '05 #1
4 1318
"Real" Windows services have to provide certain functions. But there is
a tool called SrvAny.exe that can run any program as a service. It's
part of the Microsoft Resource Kit. Not really easy to use (I tried to
use it once, but failed...). Ask Google or MSDN.

This is not strictly a Python question, but I hope it is not too far
off topic.

The question is 'How do you install a service on MSW?' Here is the
background.

The accounting application I am writing is multi-user. To handle
logins, record locking, etc, I have written a simple socket server
program to keep track of various activities, which must run in the
background all the time. It is written in Python and uses
socket.socket(). It works well.

I need it to work on both Linux and MSW. Up to now I have opened a
separate terminal window, and run it from there. This works fine on
both platforms. Now I want it to run as a true background service.

I have figured out how to do this in Linux. On MSW I naively expected
to be able to go to Control Panel > Adminstrative Tools > Services,
right click, and find an option to add a new service. No such luck.
Can anybody please explain how I might be able to do this, or at least
tell me where I can read up on it.

I am using Python 2.3.3 with Win32 extensions on Windows 2000 Pro.

Jul 18 '05 #2
fr***@chagford.com (Frank Millman) wrote in
news:24**************************@posting.google.c om:
I have figured out how to do this in Linux. On MSW I naively expected
to be able to go to Control Panel > Adminstrative Tools > Services,
right click, and find an option to add a new service. No such luck.
Can anybody please explain how I might be able to do this, or at least
tell me where I can read up on it.

I am using Python 2.3.3 with Win32 extensions on Windows 2000 Pro.


Try reading Python Programming on Win32 by Mark Hammond & Andy Robinson,
chapter 18 is all about services. Alternatively Google for win32serviceutil
which is the module you need to know about.

Jul 18 '05 #3
Duncan Booth <me@privacy.net> wrote in message news:<Xn***************************@127.0.0.1>...
fr***@chagford.com (Frank Millman) wrote in
news:24**************************@posting.google.c om:
I have figured out how to do this in Linux. On MSW I naively expected
to be able to go to Control Panel > Adminstrative Tools > Services,
right click, and find an option to add a new service. No such luck.
Can anybody please explain how I might be able to do this, or at least
tell me where I can read up on it.

I am using Python 2.3.3 with Win32 extensions on Windows 2000 Pro.


Try reading Python Programming on Win32 by Mark Hammond & Andy Robinson,
chapter 18 is all about services. Alternatively Google for win32serviceutil
which is the module you need to know about.


Download and install pywin32-201.win32-py2.3.exe.

In examples there is want: service.

Good luck
Jul 18 '05 #4
fr***@chagford.com (Frank Millman) wrote in message news:<24**************************@posting.google. com>...
Hi all

This is not strictly a Python question, but I hope it is not too far
off topic.

The question is 'How do you install a service on MSW?' Here is the
background.


Thanks so much for the replies - very useful.

I do not want to go to the effort of creating a full Windows service,
so I looked for srvany.exe, as suggested by Benjamin. This allows you
to run any program as a service. I installed it, and it seems to work.
I have only tried it on my personal machine so far, so I have not put
it under any stress, but it looks as if it will do the job. I will be
happy to provide details if anyone is interested.

Thanks again

Frank
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by DraguVaso | last post: by
3 posts views Thread by Jeremy S. | last post: by
2 posts views Thread by Fan Wang | last post: by
3 posts views Thread by Chris Wagner | last post: by
2 posts views Thread by John | last post: by
2 posts views Thread by =?Utf-8?B?Um9nZWxpbw==?= | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.