Force Restart or launch external application
Tuesday, February 14, 2006 by frasej | Discussion: DesktopX
Reply #2 Tuesday, February 14, 2006 3:45 PM
Reply #3 Tuesday, February 14, 2006 4:41 PM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Tuesday, February 14, 2006 3:29 PM
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
Another option is to create a batch file that has the text shutdown.exe -f -r