[THIN] Re: OT: WMI - Installed Memory vs Available Memory

  • From: "Jeremy Saunders" <jeremy@xxxxxxxxxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Fri, 10 Feb 2012 15:29:47 +0800

Yep, that's happened to me before, so I use Win32_PhysicalMemory to get the
real number.

 

strComputer = "."

Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemory",
"WQL", _

  wbemFlagReturnImmediately + wbemFlagForwardOnly)

intTotalPhysicalMemory = 0

For Each objItem In colItems

  intMemory = ((objItem.capacity) / 1024) / 1024

  intTotalPhysicalMemory = intTotalPhysicalMemory + intMemory

Next 

wscript.echo "Total Physical Memory Installed : " & intTotalPhysicalMemory &
" Mb"

 

Cheers,

Jeremy.

 

From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On Behalf
Of Steve Snyder
Sent: Friday, 10 February 2012 3:05 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] OT: WMI - Installed Memory vs Available Memory

 

Ok,

Right-click on My Computer, select properties and look at the memory listed,
probably something like 4.00GB. Now bring up taskman and on the Performance
tab look at Physical Memory: Total. mine is 3324MB.

What WMI string do I use to see the installed memory as listed on the system
properties? Win32_ComputerSystem/TotalPhysicalMemory gives me the available
physical memory as reported in taskman.

Other related posts: