RE: Starting Win32 Service

2006-09-28 Thread Tim Golden
| Tim Golden wrote: | ... | > Yes, sorry about that, it's a well-known (to me) gotcha. | > Basically there's no way I can extract the params from | > the COM interface in a way which implies order, so I | > can't take them in positionally. (Corrections to this | > statement will be gratefully recei

Re: Starting Win32 Service

2006-09-28 Thread Roger Upole
Tim Golden wrote: ... > Yes, sorry about that, it's a well-known (to me) gotcha. > Basically there's no way I can extract the params from > the COM interface in a way which implies order, so I > can't take them in positionally. (Corrections to this > statement will be gratefully received). > > TJG

RE: Starting Win32 Service

2006-09-27 Thread Tim Golden
[placid] | > Now i was trying to use service.ChangeStartMode but each | time i pass in | > an argument i get the error; | > | > #TypeError: __call__() takes exactly 1 argument (2 given) | > | > but; | > | > >>> print service.ChangeStartMode | > (ReturnValue)> | > | > ChangeStartMode needs an argu

Re: Starting Win32 Service

2006-09-27 Thread placid
placid wrote: > Tim Golden wrote: > > [placid] > > | Using Tim Golden's wmi module you can get the service names > > | > > | import wmi > > | c = wmi.WMI () > > | stopped_services = c.Win32_Service (StartMode="Auto", State="Stopped") > > | if stopped_services: > > | for s in stopped_services: >

Re: Starting Win32 Service

2006-09-27 Thread placid
Tim Golden wrote: > [placid] > | Using Tim Golden's wmi module you can get the service names > | > | import wmi > | c = wmi.WMI () > | stopped_services = c.Win32_Service (StartMode="Auto", State="Stopped") > | if stopped_services: > | for s in stopped_services: > | print s.Caption, "service

Re: Starting Win32 Service

2006-09-27 Thread Gabriel Genellina
At Wednesday 27/9/2006 01:39, placid wrote: Using Tim Golden's wmi module you can get the service names but how do i start services that are stopped? Surely there are fancier ways: >net start servicename Gabriel Genellina Softlab SRL __

RE: Starting Win32 Service

2006-09-27 Thread Tim Golden
[placid] | Using Tim Golden's wmi module you can get the service names | | import wmi | c = wmi.WMI () | stopped_services = c.Win32_Service (StartMode="Auto", State="Stopped") | if stopped_services: | for s in stopped_services: | print s.Caption, "service is not running" | else: | print "N

Starting Win32 Service

2006-09-26 Thread placid
Hi all, Using Tim Golden's wmi module you can get the service names import wmi c = wmi.WMI () stopped_services = c.Win32_Service (StartMode="Auto", State="Stopped") if stopped_services: for s in stopped_services: print s.Caption, "service is not running" else: print "No auto services stop