How can I make Windows 2000 perform an autoshutdown and reboot?

  • Thread starter Thread starter John Snyder
  • Start date Start date
J

John Snyder

I would like to make Windows 2000 shut itself down at
0500 every morning and reboot itself. Is there a way of
doing this?
 
This VBScript should work. Use task scheduler to schedule it.

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Reboot()
Next
 
Back
Top