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.

14 lines
456 B

  1. # The following sample retrieves the associators of an instance
  2. # of Win32_LogicalDisk which are associated via the class
  3. # Win32_ComputerSystem
  4. use Win32::OLE;
  5. $objServices = Win32::OLE->GetObject('cim:root/cimv2');
  6. $objEnum = $objServices->AssociatorsOf('Win32_LogicalDisk="C:"', 'Win32_LogicalDiskToPartition');
  7. use Win32::OLE::Enum;
  8. foreach $inst (Win32::OLE::Enum->new ($objEnum)->All()) {
  9. print "$inst->{Path_}->{DisplayName}";
  10. }