win32serviceutil - remove service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ChrisH

    win32serviceutil - remove service

    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


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

    #2
    Re: win32serviceuti l - remove service

    Something like this should work if you have sufficient privileges.

    import win32service
    svc_mgr =
    win32service.Op enSCManager('se rver_name',None ,win32service.S C_MANAGER_ALL_A C
    CESS)
    svc_handle =
    win32service.Op enService(svc_m gr,'svc_name',w in32service.SER VICE_ALL_ACCESS )
    win32service.De leteService(svc _handle)

    Roger


    "ChrisH" <secun@yahoo.co m> wrote in message
    news:MPG.1b424c 3559bdcc8989684 @news2.atlantic .net...[color=blue]
    > 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/Coo...n/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.[/color]


    Comment

    Working...