Hallo Forum
könnt Ihr mal in das Script schauen und mir sagen warum ich von Autoit diese Fehlermeldung bekomme, ich verstehe es nicht ...
$objService = $objWMI.Get("Win32_Service.Name='" & $strSvcName & "'")
$objService = $objWMI^ ERROR
Spoiler anzeigen
;$intRC
;10=gestartet
; 4=wird gestoppt
; 5=gestoppt
$strComputer = "."
$strSvcName = "w32time"
$objWMI = ObjCreate("winmgmts:\\" & $strComputer & "\root\cimv2")
$objService = $objWMI.Get("Win32_Service.Name='" & $strSvcName & "'")
$intRC = $objService.StopService
if $intRC > 0 then
MsgBox(0, "Stop", "Error stopping service: " & $intRC)
else
MsgBox(0, "Stop", "Successfully stopped service")
EndIf
$intRC = $objService.StartService
if $intRC > 0 then
MsgBox(0, "Start", "Error starting service: " & $intRC)
else
MsgBox(0, "Start", "Successfully started service")
EndIf
... oder gibt es vielleicht noch eine andere Möglichkeit einen Dienst zu Restarten.
Original ist VBS aus Windows XP Cookbook und funktioniert.
Vielen Dank im Voraus
und viele Grüsse
EDIT: Status geändert