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

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

No probs. Also add the following two lines to the top of that code.

 

Const wbemFlagReturnImmediately = &h10

Const wbemFlagForwardOnly = &h20

 

 

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

 

Sweet!

I saw the physicalMemory/Capacity but only got 2GB out of it so I assumed it
was just the max size DIMM the system was capable of as my script editor
just tells me "The total capacity of this physical memory, in bytes." Didn't
realize it was per installed DIMM.

Thanks!

On Fri, Feb 10, 2012 at 8:29 AM, Jeremy Saunders
<jeremy@xxxxxxxxxxxxxxxxxxxx> wrote:

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: