Here's code I typically use... (that I haven't used since 2K and could be flaky on XP)
my $class = "Win32_LogicalDisk"; my $Info = $SWbemServices->InstancesOf( $class ) || die "Could not access instances of $class on $hostname"; for my $Item (in ($Info) ) { if ( $Item->{DriveType} == 3 ) { my $size = int( $Item->{Size} / (1024 * 1024 * 1024) ); my $free = int( $Item->{FreeSpace} / (1024 * 1024 * 1024) ); print $Item->{Name} . " $size GB\n"; } }
--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
In reply to Re: WMI and Perl
by Solo
in thread WMI and Perl
by softworkz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |