By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,705 Members | 2,013 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,705 IT Pros & Developers. It's quick & easy.

stopping windows services

P: n/a
Can Python be used to stop windows services? I'm writing a script to
automaically remove some troublesome Symantec software, but before
running the main removal script, I need to kill some services.

Thanks,
Bart
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Get WService from http://starship.python.net/crew/mhammond. Then, for
example:

import WService
import time

listener = WService.WService("Network Associates McShield")
listener.status(1)
if listener.status(0) != 'STOPPED':
print "Stopping Network Associates McShield..."
listener.stop()
time.sleep(5)
listener.status(1)

On Thu, 19 Aug 2004 21:52:33 -0400, Bart Nessux
<ba*********@hotmail.com> wrote:
Can Python be used to stop windows services? I'm writing a script to
automaically remove some troublesome Symantec software, but before
running the main removal script, I need to kill some services.

Thanks,
Bart


Jul 18 '05 #2

P: n/a

"Bart Nessux" <ba*********@hotmail.com> wrote in message
news:cg**********@solaris.cc.vt.edu...
Can Python be used to stop windows services? I'm writing a script to
automaically remove some troublesome Symantec software, but before
running the main removal script, I need to kill some services.

if you know the services name, and are running under an account with
sufficient permissions, you could just use the cmd shell.

i.e. os.system('net stop Apache2') - kills my apache server, and obviously
os.system('net start Apache2') starts it again.

Probably a nicer API out there somewhere though.
Jul 18 '05 #3

P: n/a
Yes it can.

Check out the win32 extensions.

If you like, I can dig up some example code.

In article <cg**********@solaris.cc.vt.edu>, ba*********@hotmail.com
says...
Can Python be used to stop windows services? I'm writing a script to
automaically remove some troublesome Symantec software, but before
running the main removal script, I need to kill some services.

Thanks,
Bart

Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.