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.

11 lines
405 B

  1. # The following sample enumerates all instances of the class
  2. # Win32_LogicalDisk, and extract the the member with a specified
  3. # relative path.
  4. use Win32::OLE;
  5. $objServices = Win32::OLE->GetObject('cim:root/cimv2');
  6. $objEnum = $objServices->ExecQuery ('select * from Win32_LogicalDisk');
  7. $objInstance = $objEnum->{'Win32_LogicalDisk="C:"'};
  8. print "$objInstance->{Path_}->{DisplayName}\n";