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.

30 lines
916 B

  1. on error resume next
  2. 'Create a keyed class with a defaulted property
  3. set service = GetObject("Winmgmts:")
  4. set aclass = service.get
  5. aclass.path_.class = "REMOVETEST00"
  6. set property = aclass.properties_.add ("p", 19)
  7. property.qualifiers_.add "key", true
  8. aclass.properties_.add ("q", 19).Value = 12
  9. aclass.put_
  10. 'create an instance and override the property
  11. set instance = service.get ("RemoveTest00").spawninstance_
  12. instance.properties_("q").Value = 24
  13. instance.properties_("p").Value = 1
  14. instance.put_
  15. 'retrieve the instance and remove the property
  16. set instance = service.get ("removetest00=1")
  17. set property = instance.properties_ ("q")
  18. WScript.echo property.value, property.islocal
  19. instance.properties_.remove "q"
  20. set property = instance.properties_ ("q")
  21. WScript.echo property.value, property.islocal
  22. if err <> 0 then
  23. WScript.Echo Err.Number, Err.Description, Err.Source
  24. end if