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.

48 lines
1.3 KiB

  1. On Error Resume Next
  2. Set Service = GetObject("winmgmts:root/default")
  3. Set aClass = Service.Get()
  4. aClass.Path_.Class = "Qualtest00"
  5. Set Qualifiers = aClass.Qualifiers_
  6. Qualifiers.Add "qbool", true, true, true, false
  7. Qualifiers.Add "qsint32", 345
  8. Qualifiers.Add "qreal64", -345.675
  9. Qualifiers.Add "qstring", "freddy the frog"
  10. Qualifiers.Add "qstring2", "freddy the froggie", false
  11. Qualifiers.Add "qstring3", "freddy the froggies", false, false
  12. Qualifiers.Add "qstring4", "freddy the froggiess", true, false
  13. Qualifiers.Add "qstring5", "wibble", true, true, false
  14. Qualifiers.Add "aqbool", Array(true, false, true)
  15. Qualifiers.Add "aqsint32", Array (10, -12)
  16. Qualifiers.Add "aqreal64", Array(-2.3, 2.456, 12.356567897)
  17. Qualifiers.Add "aqstring", Array("lahdi", "dah", "wibble")
  18. Qualifiers("qsint32").Value = 7677
  19. WScript.Echo "There are", Qualifiers.Count, "Qualifiers in the collection"
  20. for each qualifier in Qualifiers
  21. If (IsArray(qualifier)) Then
  22. str = qualifier.Name & "={"
  23. for x=LBound(qualifier) to UBound(qualifier)
  24. v =qualifier
  25. str = str & v(x)
  26. if x <> UBound(qualifier) then
  27. str = str & ", "
  28. end if
  29. next
  30. str = str & "}"
  31. WScript.Echo str
  32. Else
  33. WScript.Echo qualifier.Name, "=", qualifier
  34. End If
  35. Next
  36. if Err <> 0 Then
  37. WScript.Echo Err.Description
  38. End if
  39. aClass.Put_