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.

31 lines
990 B

  1. //***************************************************************************
  2. // This script tests the setting of null property values
  3. // and null method parameters
  4. //***************************************************************************
  5. var Locator = new ActiveXObject("WbemScripting.SWbemLocator");
  6. // Note next call uses "null" for first argument
  7. var Service = Locator.ConnectServer (null, "root/default");
  8. var Class = Service.Get();
  9. // Set up a new class with an initialized property value
  10. Class.Path_.Class = "FredJS";
  11. Class.Properties_.Add ("P", 3).Value = 25;
  12. Class.Put_ ();
  13. // Now null the property value using non-dot access
  14. Class = Service.Get ("FredJS");
  15. var Property = Class.Properties_("P");
  16. Property.Value = null;
  17. Class.Put_ ();
  18. // Un-null
  19. Class = Service.Get ("FredJS");
  20. Property = Class.Properties_("P");
  21. Property.Value = 56;
  22. Class.Put_()
  23. // Now null it using dot access
  24. Class = Service.Get("FredJS");
  25. Class.P = null;
  26. Class.Put_();