Jump to content

read ram bank mounting.


Recommended Posts

Hi.

I need to quickly read the physical RAM configuration of a lot of PCs. Aida / Everest is collecting far too much info.

The results shall go to a INI file like this (that's no problem), but I simply don't know how to collect the wanted data:

--------- RamConfig.INI ---------------------
[512MB]
PC1-123=DDR1|Bank1 256MB|Bank2 256MB|Bank3 free|Bank4 free|WinXP

[4GB]
PC4-007=DDR3|Bank1 2048MB|Bank2 2048MB|Win7-64

[3GB}
PC1-123=DDR2|Bank1 1024|Bank2 512|Bank3 1024|Bank3 512|Win7-32

...
---------------- EOF ----------------------

So I was looking at WMI Win32_PhysicalMemory using ScriptomaticV2.hta:

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("PC4-006")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemory", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "-----------------------------------------"
      WScript.Echo "DeviceLocator: " & objItem.DeviceLocator
      WScript.Echo "Capacity: " & objItem.Capacity
      WScript.Echo "PositionInRow: " & objItem.PositionInRow
      WScript.Echo "Tag: " & objItem.Tag
      WScript.Echo "DataWidth: " & objItem.DataWidth
      WScript.Echo "Description: " & objItem.Description
      WScript.Echo "FormFactor: " & objItem.FormFactor
      WScript.Echo "Manufacturer: " & objItem.Manufacturer
      WScript.Echo "MemoryType: " & objItem.MemoryType
      WScript.Echo "Model: " & objItem.Model
       WScript.Echo "Speed: " & objItem.Speed
      WScript.Echo "Status: " & objItem.Status
      WScript.Echo "TotalWidth: " & objItem.TotalWidth
      WScript.Echo "TypeDetail: " & objItem.TypeDetail
      WScript.Echo "Version: " & objItem.Version
      WScript.Echo
   Next
Next


Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm: 
    WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
    Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
    & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function

The output looks similar to this for several PCs. This one has 4 RAM banks, bank 3 + 4 have 2GB RAM mounted:

==========================================
Computer: PC4-246
==========================================
-----------------------------------------
DeviceLocator: XMM3
Capacity: 2147483648
PositionInRow: 1
Tag: Physical Memory 2
DataWidth: 64
FormFactor: 8
Manufacturer: 
MemoryType: 0
Model: 
Speed: 1333
Status: 
TotalWidth: 64
TypeDetail: 128
Version: 

-----------------------------------------
DeviceLocator: XMM4
Capacity: 2147483648
PositionInRow: 1
Tag: Physical Memory 3
DataWidth: 64
FormFactor: 8
Manufacturer: 
MemoryType: 0
Model: 
Speed: 1333
Status: 
TotalWidth: 64
TypeDetail: 128
Version: 

-----------------------------------------
DeviceLocator: SYSTEM ROM
Capacity: 1048576
PositionInRow: 1
Tag: Physical Memory 4
DataWidth: 2
FormFactor: 0
Manufacturer: 
MemoryType: 11
Model: 
Speed: 
Status: 
TotalWidth: 2
TypeDetail: 4096
Version:

So by this I can only "see" the banks, that are ALREADY mounted, but not free banks. :mellow:

Maybe somebody already coded something like what I'm trying to do?

Could also be a stand alone EXE to be used with autoit.

Regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

All banks should be displayed in Win32_PhysicalMemoryArray by counting all MemoryDevices values.

installed banks -> Win32_PhysicalMemoryLocation

memory size -> Win32_PhysicalMemory

amount of banks ->Win32_PhysicalMemoryArray

BR,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Hi.

All banks should be displayed in Win32_PhysicalMemoryArray by counting all MemoryDevices values.

amount of banks ->Win32_PhysicalMemoryArray

BR,

UEZ

I had a look at that one, too. But I couldn't see the number of banks from the following output:

----------------------------------------------------------
Caption: Realer Speicherarray
CreationClassName: Win32_PhysicalMemoryArray
Depth: 
Description: Realer Speicherarray
Height: 
HotSwappable: 

Location: 3
Manufacturer: 
MaxCapacity: 16777216
MemoryDevices: 4
MemoryErrorCorrection: 3
Model: 
Name: Realer Speicherarray
OtherIdentifyingInfo: 
PartNumber: 
PoweredOn: 
Removable: 
Replaceable: 
SerialNumber: 
SKU: 
Status: 
Tag: Physical Memory Array 0
Use: 3
Version: 
Weight: 
Width: 

----------------------------------------------------------
Caption: Realer Speicherarray
CreationClassName: Win32_PhysicalMemoryArray
Depth: 
Description: Realer Speicherarray
Height: 
HotSwappable: 

Location: 3
Manufacturer: 
MaxCapacity: 4096
MemoryDevices: 1
MemoryErrorCorrection: 3
Model: 
Name: Realer Speicherarray
OtherIdentifyingInfo: 
PartNumber: 
PoweredOn: 
Removable: 
Replaceable: 
SerialNumber: 
SKU: 
Status: 
Tag: Physical Memory Array 1
Use: 5
Version: 
Weight: 
Width:

After rereading the output, I recognized, that the upper block is the RAM with 4 banks (MemoryDevices: 4), the lower is the ROM.

MaxCapacity will be the value to distinguish RAM from ROM, in case the order might toggle...

the only differences between RAM and ROM are these:

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("PC4-006")
For Each strComputer In arrComputers
   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemoryArray", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "----------------------------------------------------------"
      WScript.Echo "MaxCapacity: " & objItem.MaxCapacity
      WScript.Echo "MemoryDevices: " & objItem.MemoryDevices
      WScript.Echo "Tag: " & objItem.Tag
      WScript.Echo "Use: " & objItem.Use
   Next
Next


Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm: 
    WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
    Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
    & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function

result:

----------------------------------------------------------
MaxCapacity: 16777216
MemoryDevices: 4
Tag: Physical Memory Array 0
Use: 3
----------------------------------------------------------
MaxCapacity: 4096
MemoryDevices: 1
Tag: Physical Memory Array 1
Use: 5

Thanks, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...