I want to use VBScript to check if the Spooler service is running and if it is not running, the code below checks the status of the service, but I need help to change this so that I can check if it is running.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colRunningServices = objWMIService.ExecQuery _
("Select * from Win32_Service")
For Each objService in colRunningServices
Wscript.Echo objService.DisplayName & VbTab & objService.State
Next
Thanks a lot Steven
source
share