in reply to Re^4: Stopping Service with Win32::StopService
in thread Stopping Service with Win32::StopService
It's pretty simple to parse the output of the sc query servicename command:
C:\test>sc query pgsql-8.2 SERVICE_NAME: pgsql-8.2 TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING (STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0
You can also query this information using DBI, DBD::WMI and the bastardised WQL, but I find structure of WMI unfathomable and the documentation abysmal.
|
|---|