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.

19 lines
508 B

  1. on error resume next
  2. const wbemPrivilegeShutdown = 18
  3. set locator = CreateObject("WbemScripting.SWbemLocator")
  4. locator.security_.privileges.Add wbemPrivilegeShutdown
  5. set service = locator.connectserver
  6. service.security_.impersonationLevel = 3
  7. set osset = service.instancesof ("Win32_OperatingSystem")
  8. for each os in osset
  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