in reply to WMI and Perl
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: WMI and Perl
by softworkz (Monk) on Jan 25, 2005 at 16:35 UTC |