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.

18 lines
535 B

  1. on error resume next
  2. const wbemPrivilegeShutdown = 18
  3. set service = getobject("winmgmts:{impersonationLevel=impersonate}")
  4. service.security_.impersonationLevel = 3
  5. service.security_.privileges.Add wbemPrivilegeShutdown
  6. set osset = service.instancesof ("Win32_OperatingSystem")
  7. for each os in osset
  8. WScript "About to shut down os " & os.path_.relpath
  9. result = os.Shutdown ()
  10. if err <> 0 then
  11. WScript.Echo Hex(Err.Number), Err.Description
  12. else
  13. WScript.Echo "Shutdown returned result " & result
  14. end if
  15. next