Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
411 B

  1. Set Args = wscript.Arguments
  2. RpNum = Args.item(0)
  3. Set obj = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")
  4. if obj.Restore(RpNum) <> 0 Then
  5. wscript.Echo "Restore failed"
  6. End If
  7. Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
  8. for each OpSys in OpSysSet
  9. OpSys.Reboot()
  10. next