Force Restart or launch external application
from
WinCustomize Forums
I need to know how to do a system restart, or at least, launch an external program.
Stardock will be closed for the week starting on Monday, June 29th and we will be returning on Monday, July 6th. We will be monitoring support tickets and forums during this time but expect delays in responses during this time.
| Public Sub ServerReboot(strServer) On Error Resume Next Set objWMIService = GetObject("winmgmts: {impersonationLevel=impersonate,(Shutdown)}!\\" & strServer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems ObjOperatingSystem.Win32Shutdown (6)'(6) is a forced reboot Next Set objWMIService = nothing Set colOperatingSystems = nothing End Sub |
Welcome Guest! Please take the time to register with us.