[python-win32] Windows services in python

Tim Roberts timr at probo.com
Sat Sep 1 00:17:41 CEST 2007


Dmitry Alekseenko wrote:
> win32service methods produces the same problem:
>
> def Enable(self, serviceName, enable, autoStart=False):  
>     startType = None
>     if not enable:
>         startType = win32service.SERVICE_DISABLED
>     elif autoStart:
>         startType = win32service.SERVICE_AUTO_START
>     else:
>         startType = win32service.SERVICE_DEMAND_START
>
>     scm = win32service.OpenSCManager (None, None,
>                                      win32service.SC_MANAGER_ALL_ACCESS)
>     svc = win32service.OpenService(scm, serviceName,
>                                    win32service.SC_MANAGER_ALL_ACCESS)
>     win32service.ChangeServiceConfig(svc, win32service.SERVICE_NO_CHANGE,
>                                      startType,
>                                      win32service.SERVICE_NO_CHANGE,
>                                      None, None, 0, None, None, None,
> None)
>     win32service.CloseServiceHandle(svc)

I'm afraid I don't believe you.  Did you change the ImagePath back to
its proper value before you tested this?  (It should be
"%SystemRoot%\System32\svchost.exe -k netsvcs")  Remember, this won't
fix the damage that your previous script did; it just leaves ImagePath
where it was.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list