For a WinXP guest VM I don't get anything when querying for
Win32_PhysicalMemory. But on the other hand you can get memory
information from Win32_OperatingSystem
--
rocku
BRZEZINSKI, PAUL pisze:
> I written a WMI query that attempts to obtain physical memory capacity via
> WMI call. Works as expected on live PCs but returns strange results on a
> guest OS hosted by Virtual PC 2007. Anyone else run into this?
>
> Ideas how to solve?
>
> Sample code:
> --
> use strict;
> use warnings;
> use Win32::OLE qw(in);
>
> my( $objWMI ) = Win32::OLE->GetObject('winmgmts:\\\\.\\root\\cimv2');
> my( $colItems ) = $objWMI->ExecQuery( 'Select * from Win32_PhysicalMemory' );
>
> foreach my $objItem (in $colItems) {
> $totalMem += $objItem->{Capacity} / ( 1024 * 1024 );
> }
>
> print $totalMem, "\n";
> --
> Produces output of 64 (MB), when the memory allocated to the guest on the
> settings dialog is 1.5G. On the guest, when I right-click on the Computer
> icon on the desktop then select properties shows the correct/expected amount
> of memory allocated.
>
> Suggestions? Is there a different branch to query instead of \root\cimv2?
> _______________________________________________
> Perl-Win32-Users mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs