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.

57 lines
1.4 KiB

  1. var Class = GetObject("winmgmts:root/cimv2:win32_service");
  2. //Test the collection properties of IWbemMethodSet
  3. var e = new Enumerator (Class.Methods_);
  4. for (;!e.atEnd();e.moveNext ())
  5. {
  6. var Method = e.item ();
  7. WScript.Echo ("***************************");
  8. WScript.Echo ("METHOD:", Method.Name, "from class", Method.Origin);
  9. WScript.Echo ();
  10. WScript.Echo (" Qualifiers:");
  11. var eQ = new Enumerator (Method.Qualifiers_);
  12. for (;!eQ.atEnd();eQ.moveNext ())
  13. {
  14. var Qualifier = eQ.item ();
  15. WScript.Echo (" ", Qualifier.Name, "=", Qualifier.Value);
  16. }
  17. WScript.Echo ();
  18. WScript.Echo (" In Parameters:");
  19. var inParams = Method.InParameters;
  20. if (inParams != null)
  21. {
  22. var eP = new Enumerator (inParams.Properties_);
  23. for (;!eP.atEnd();eP.moveNext ())
  24. {
  25. var InParameter = eP.item ();
  26. WScript.Echo (" ", InParameter.Name, "<", InParameter.CIMType, ">");
  27. }
  28. }
  29. WScript.Echo ();
  30. WScript.Echo (" Out Parameters");
  31. var outParams = Method.OutParameters;
  32. if (outParams != null)
  33. {
  34. var eO = new Enumerator (outParams.Properties_);
  35. for (;!eO.atEnd();eO.moveNext ())
  36. {
  37. var OutParameter = eO.item ();
  38. WScript.Echo (" ", OutParameter.Name, "<", OutParameter.CIMType, ">");
  39. }
  40. }
  41. WScript.Echo ();
  42. WScript.Echo ();
  43. }
  44. //Test the Item and Count properties of IWbemMethodSet
  45. WScript.Echo (Class.Methods_("StartService").Name);
  46. WScript.Echo (Class.Methods_.Count);