After more research I found that Win32_OperatingSystem has a property called TotalVisibleMemorySize, which addresses my original question.
Paul -- Paul J. Brzezinski Integration Engineering - GM EDS, an HP company Phone:+1-248-365-9615(8-355) P paul.brzezin...@hp.com -----Original Message----- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of BRZEZINSKI, PAUL Sent: Thursday, August 13, 2009 3:48 PM To: perl-win32-users@listserv.ActiveState.com Subject: WMI Win32_PhysicalMemory on Virtual PC 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 Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs