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.

26 lines
854 B

  1. '***************************************************************************
  2. 'This script tests the enumeration of subclasses
  3. '***************************************************************************
  4. On Error Resume Next
  5. Set Service = GetObject("winmgmts:")
  6. Set DiskSubclass = Service.Get("CIM_LogicalDisk").SpawnDerivedClass_()
  7. 'Set the name of the subclass
  8. DiskSubClass.Path_.Class = "SUBCLASSTEST00"
  9. 'Add a property to the subclass
  10. Set NewProperty = DiskSubClass.Properties_.Add ("MyNewProperty", 19)
  11. NewProperty.Value = 12
  12. 'Add a qualifier to the property with an integer array value
  13. NewProperty.Qualifiers_.Add "MyNewPropertyQualifier", Array (1,2,3)
  14. 'Persist the subclass in CIMOM
  15. DiskSubclass.Put_ ()
  16. 'Now delete it
  17. Service.Delete "SUBCLASSTEST00"
  18. if Err <> 0 Then
  19. WScript.Echo Err.Description
  20. Err.Clear
  21. End if