scheduling

  • Thread starter Thread starter Susanne
  • Start date Start date
S

Susanne

Hi
I would like to scheduling my server to restart 2 times a week. windows 2000
(terminal server) How do I do?

Sus
 
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