win32serviceutil - remove service

C

ChrisH

Does anyone know of a way to remove a Windows service on a remote
machine using python?

I found the following link on ASPN that tells you how to do just about
everything but remove a service.

Manipulating Windows Services
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/59872

According to the article, the answer is in Python Programming on Win32.
I have that book and still can't find the answer.
 
R

Roger Upole

Something like this should work if you have sufficient privileges.

import win32service
svc_mgr =
win32service.OpenSCManager('server_name',None,win32service.SC_MANAGER_ALL_AC
CESS)
svc_handle =
win32service.OpenService(svc_mgr,'svc_name',win32service.SERVICE_ALL_ACCESS)
win32service.DeleteService(svc_handle)

Roger
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top