Hi, i need a way of checking if a service is running. Is their a way of doing this as i want to include this check in an if statment for an installer. I cant seem to find anything on services in the help file? Am i just not looking hard enough?
many ways:
$service = "dhcp"
MsgBox(0, $service, _RetrieveServiceState(@ComputerName, $service))
Func _RetrieveServiceState($s_Machine, $s_ServiceName)
Local Const $wbemFlagReturnImmediately = 0x10
Local Const $wbemFlagForwardOnly = 0x20
Local $colItems = "", $objItem
Local $objWMIService = ObjGet("winmgmts:\\" & $s_Machine & "\root\CIMV2")
If @error Then
MsgBox(16, "_RetrieveServiceState", "ObjGet Error: winmgmts")
Return
EndIf
$colItems = $objWMIService.ExecQuery ("SELE