Reboot shortcut

  • Thread starter Thread starter WP
  • Start date Start date
Create a text file named reboot.vbs and paste in the text below.
------------------------------------
Set colOperatingSystems = GetObject_
("winmgmts:{(Shutdown)}").ExecQuery("Select * from
Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(1)
Next
------------------------------------

Create a text file named logoff.vbs and paste in the text below.
------------------------------------
Set colOperatingSystems = GetObject_
("winmgmts:{(Shutdown)}").ExecQuery("Select * from
Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(0)
Next
 
reboot.vbs should have been;
------------------------------------
Set colOperatingSystems = GetObject_
("winmgmts:{(Shutdown)}").ExecQuery("Select * from
Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(2)
Next
 
You can also get restart.vbs (for rebooting) included in the Windows
2000 Resource Kit from:

ftp://ftp.microsoft.com/ResKit/win2000/
 
Back
Top