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.

24 lines
833 B

  1. on error resume next
  2. Set Locator = CreateObject("WbemScripting.SWbemLocator")
  3. Set Services = Locator.ConnectServer(, "root\CIMV2")
  4. If IsObject(Services) Then
  5. Set objSet = Services.InstancesOf("Win32_OperatingSystem")
  6. For Each obj In objSet
  7. WScript.Echo (obj.Path_)
  8. Set objItem = objSet.Item(obj.Path_)
  9. If Err = 0 Then
  10. If objItem.Path_ <> obj.Path_ Then
  11. WScript.Echo "SWbemObjectSet.Item is accessible but incorrect -> Error " & " (0x" & Hex(Err) & ")"
  12. Else
  13. WScript.Echo "PASS"
  14. End If
  15. Else
  16. WScript.Echo "SWbemObjectSet.Item not accessible -> Error: " & Err.Description & " (0x" & Hex(Err) & ")"
  17. Exit For
  18. End If
  19. Next
  20. End If
  21. Err.Clear
  22. ' TODO - add Item tests for results sets from UMI objects