2025-04-27 07:49:33 -04:00

15 lines
456 B
Perl

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