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 ("S