in reply to WMI and Perl

According to the MSDN Library doc, the Win32_Volume class is not available on XP or prior windows versions. Could that be your problem?

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
    Thanks Solo, yea I'm aware of that, this script runs on windoze 2003 enterprise. Thanks