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.

41 lines
1.0 KiB

  1. var locator = WScript.CreateObject ("WbemScripting.SWbemLocator");
  2. var services = locator.ConnectServer (".", "root/cimv2");
  3. var classa = services.Get ("Win32_baseservice");
  4. var props = classa.Properties_;
  5. WScript.Echo ("There are", props.Count, "properties");
  6. var e = new Enumerator (props);
  7. for (;!e.atEnd();e.moveNext())
  8. {
  9. p = e.item ();
  10. if (p.Value == null)
  11. WScript.Echo (p.Name, p.Origin, p.IsLocal, p.IsArray);
  12. else
  13. WScript.Echo (p.Name, "=", p, p.Origin, p.IsLocal, p.IsArray);
  14. var eq = new Enumerator (p.Qualifiers_);
  15. WScript.Echo ("\nQualifiers\n");
  16. for (;!eq.atEnd();eq.moveNext())
  17. {
  18. q = eq.item ();
  19. // Array values from COM are probably reported as "unknown" or "undefined"
  20. WScript.Echo (q.Name, "[", typeof(q.Value), "]");
  21. if (typeof(q.Value) != "unknown")
  22. WScript.Echo (q.Name, "=", q);
  23. else
  24. {
  25. var arrayval = new VBArray (q.Value).toArray();
  26. WScript.Echo (arrayval.length);
  27. for (i = 0; i < arrayval.length; i++)
  28. WScript.Echo (arrayval[i]);
  29. }
  30. }
  31. }