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
723 B

  1. var Service = GetObject("winmgmts:{impersonationLevel=impersonate}!root/cimv2");
  2. Service.Security_.ImpersonationLevel = 3;
  3. // Use the Enumerator helper to manipulate collections
  4. var e = new Enumerator (Service.AssociatorsOf
  5. ('\\ALANBOS3\Root\CimV2:Win32_DiskPartition.DeviceID="Disk #0, Partition #1"', null, "Win32_ComputerSystem", null, null, true));
  6. for (;!e.atEnd();e.moveNext ())
  7. {
  8. var y = e.item ();
  9. WScript.Echo (y.Path_.Relpath);
  10. }
  11. //Do it via a ISWbemObject
  12. var Object = GetObject("winmgmts:Win32_DiskPartition");
  13. e = new Enumerator (Object.Associators_ (null,null,null,null,null,true));
  14. for (;!e.atEnd();e.moveNext ())
  15. {
  16. var y = e.item ();
  17. WScript.Echo (y.Path_.Relpath);
  18. }