soundmachine123
Level-2
- Beiträge
- 102
- Reaktionspunkte
- 2
-> Hier kostenlos registrieren
Hallo Leute,
ich habe eine WinCC flexible Runtime auf einem Windows XP Rechner. Nun möchte ich per Button die Runtime beenden und den PC nicht nur herunterfahren, sondern Neu starten.
Folgendes Skript hatt eich schon im Forum gefunden, welches aber nicht funktioniert.
Hat jemand noch eine andere Idee?
Dim OpSysSet, obj
Set OpSysSet = GetObject("winmgmts:{impersonationLevel=impersonate," & _
"(Shutdown)}//./root/cimv2").ExecQuery _
("SELECT * FROM Win32_OperatingSystem" &_
" WHERE Primary=true")
For Each obj In OpSysSet
obj.Win32Shutdown(2)
Next
ich habe eine WinCC flexible Runtime auf einem Windows XP Rechner. Nun möchte ich per Button die Runtime beenden und den PC nicht nur herunterfahren, sondern Neu starten.
Folgendes Skript hatt eich schon im Forum gefunden, welches aber nicht funktioniert.
Hat jemand noch eine andere Idee?
Dim OpSysSet, obj
Set OpSysSet = GetObject("winmgmts:{impersonationLevel=impersonate," & _
"(Shutdown)}//./root/cimv2").ExecQuery _
("SELECT * FROM Win32_OperatingSystem" &_
" WHERE Primary=true")
For Each obj In OpSysSet
obj.Win32Shutdown(2)
Next