82

How to find the RAM type (DDR2/DDR3) of the system using command prompt?

I have tried SYSTEMINFO in command prompt but it did not display the RAM type.

phuclv
  • 26,555
  • 15
  • 113
  • 235
baalji av
  • 831
  • 1
  • 7
  • 3
  • Do you know the model of your motherboard? If not, see this http://superuser.com/questions/175213/find-out-what-the-motherboard-on-my-computer-is then look up the manual to find out! – Dave Jun 11 '13 at 14:03
  • 2
    There is very likely a good duplicate on SU, but the one marked is definitely NOT a duplicate. – music2myear Jan 31 '18 at 20:13
  • Agreed. A couple of the “answers” to that other question are actually answers to this question; i.e., they were posted in the wrong place. In particular, [@terdon’s `lshw` answer](https://superuser.com/q/573375/150988#573381) to the other question might make a valuable addition to this thread (except for the fact that it’s Linux-centric, and this question is about Windows). But the linked question is not a duplicate of this one. – Scott - Слава Україні Oct 21 '18 at 17:19

9 Answers9

100

You can use the wmic command to find out the information about your memory:

wmic MemoryChip get BankLabel, Capacity, MemoryType, TypeDetail, Speed

The MemoryType returns the type of your Memory: 21=DDR-2 etc. Here is a complete list of information you can get from the MemoryChip Class.

In my case unfortunately the type is unknown (0), but I still get some useful information:

wmic output

phuclv
  • 26,555
  • 15
  • 113
  • 235
FiveO
  • 8,228
  • 12
  • 48
  • 77
  • 2
    Thank u. When I enter this command it displays memory type as 21 which is equal to DDR2, but the actual memory type in my slot is DDR3. It does confusing.pls explain. – baalji av Jun 11 '13 at 15:14
  • 1
    @baaljiav: What do CPU-Z, Speccy etc. show? Is there any specific reason you want to display the info at the command prompt? – Karan Jun 11 '13 at 15:24
  • @Karan, Wouldn't CPU-Z show the same as the cmd? Indeed wouldn't the cmd be more reliable than CPU-Z? – Pacerier May 16 '15 at 20:47
  • @Pacerier: Phew, you're asking me about a comment posted almost 2 years back! From what I see I was responding to the OP saying that wmic's output wasn't matching the actual memory he installed, and thus suggested double-checking with CPU-Z, Speecy and the like. – Karan May 16 '15 at 20:58
  • @Karan, How does CPU-Z do it then, if cmd is not able to do it? – Pacerier May 24 '15 at 14:06
  • @Pacerier: Why, are you claiming CPU-Z and wmic (not cmd) employ the exact same code? If you want to know how CPU-Z works you can get hold of its source code if available and check. Also, I'm not the one claiming that wmic cannot do something. The OP said wmic's output doesn't match reality, so perhaps you should ask him whether he found CPU-Z's output more in line with his expectations or not. Good luck with that though given how old this question is. I am not going to debate any more about simple suggestions I made in a comment 2 years ago. – Karan May 24 '15 at 19:08
  • 1
    If you see a 0 there, there are chances that it’s a DDR4 RAM, unknown to WMIC command. – Jayendran Dec 13 '17 at 07:12
  • [An answer by “myrobostation BG”](https://superuser.com/q/606318/150988#1289937) suggests adding the `DeviceLocator` property. – Scott - Слава Україні Oct 21 '18 at 16:51
  • @Pacerier cmd doesn't do anything. It's [`wmic`](https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmic) that does the job. But the implementation in wmic is old and hasn't been updated to the latest SMBIOS specs so it doesn't recognize anything beyond DDR2. See [my answer](https://superuser.com/a/1540441/241386) for an updated solution. CPU-Z and Speccy are doing the same way to detect memory configuration – phuclv Apr 10 '20 at 02:08
  • 1
    Does not work with DDR4 – Oliver Meyer Nov 15 '20 at 13:43
38

There is software out there that gathers information on some of the main devices of your system.

These program will display the details for you (and more). One example is CPU-Z. A screenshot that shows the information you are looking for:

Screenshot

Now, as per the excellent comment left by Breakthrough (I've copied it in case for any reason he decides to delete his comment):

You can run CPU-Z from a command prompt, and using the -txt=report.txt will place the CPU-Z output into the file report.txt without invoking the GUI (it also mentions a -console switch to output the information to STDOUT, but says it works under Windows XP only for some reason). See additional parameters here for additional details. – Breakthrough

Dave
  • 25,297
  • 10
  • 57
  • 69
16

For a better look of the output, consider adding list full after wmic memorychip.

i.e., open cmd then type wmic memorychip list full

enter image description here

abel
  • 169
  • 1
  • 3
  • 1
    Look at the `MemoryType=0` line, wmic can't detect DD4 or other new types of memory because it hasn't been updated to the latest SMBIOS spec so don't use it. See [my answer](https://superuser.com/a/1540441/241386) for a solution that actually works – phuclv Apr 10 '20 at 02:12
10

wmic MemoryChip is highly outdated and doesn't show correct outputs for DDR3 and up. I've written a PowerShell script that reads the raw SMBIOS tables and parse the Memory Device table (Type 17). Currently it's based on SMBIOS specification version 3.4.0a and will need to be updated in the future if there any new RAM types in the new spec

Sample output:

D:\> .\ram_type.ps1
Size: 8,589,934,592 bytes (8 GB)
Memory form factor: 0x09 DIMM
Memory type: 0x1A (DDR4)
Type detail: 0x80 (Synchronous)
Speed: 2,666 MT/s
=======================
Size: 8,589,934,592 bytes (8 GB)
Memory form factor: 0x09 DIMM
Memory type: 0x1A (DDR4)
Type detail: 0x80 (Synchronous)
Speed: 2,666 MT/s
=======================

Here's the script. Tested on many PCs with DDR3 and DDR4. On many cases you'll see "0 GB" entries because there are still empty slots in the machine

Just save it as *.ps1 and run, or copy the whole script and paste into PowerShell

# Based on System Management BIOS (SMBIOS) Reference Specification 3.4.0a
# https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0a.pdf

# 7.18.1. Form factor @offset 0x0E
[string[]]$FORM_FACTORS = @(
    'Invalid', 'Other', 'Unknown', 'SIMM',                      # 00-03h
    'SIP', 'Chip', 'DIP', 'ZIP'                                 # 04-07h
    'Proprietary Card', 'DIMM', 'TSOP', 'Row of chips',         # 08-0Bh
    'RIMM', 'SODIMM', 'SRIMM', 'FB-DIMM',                       # 0C-0Fh
    'Die'                                                       # 10h
)
# 7.18.2. Memory type @offset 0x12
[string[]]$MEMORY_TYPES = @(
    'Invalid',  'Other',    'Unknown',  'DRAM',                 # 00-03h
    'EDRAM',    'VRAM',     'SRAM',     'RAM',                  # 04-07h
    'ROM',      'FLASH',    'EEPROM',   'FEPROM',               # 08-0Bh
    'EPROM',    'CDRAM',    '3DRAM',    'SDRAM',                # 0C-0Fh
    'SGRAM',    'RDRAM',    'DDR',      'DDR2',                 # 10-13h
    'DDR2 FB-DIMM', 'Reserved', 'Reserved', 'Reserved',         # 14-17h
    'DDR3',     'FBD2',     'DDR4',     'LPDDR',                # 18-1Bh
    'LPDDR2',   'LPDDR3',   'LPDDR4',   'Logical non-volatile device' # 1C-1Fh
    'HBM (High Bandwidth Memory)', 'HBM2 (High Bandwidth Memory Generation 2)',
        'DDR5', 'LPDDR5'                                        # 20-23h
)
# 7.18.3. Type detail @offset 0x13
[string[]]$TYPE_DETAILS = @(
    'Reserved', 'Other', 'Unknown', 'Fast-paged',               # bit 0-3
    'Static column', 'Pseudo-static', 'RAMBUS', 'Synchronous',  # bit 4-7
    'CMOS', 'EDO', 'Window DRAM', 'Cache DRAM',                 # bit 8-11
    'Non-volatile', 'Registered (Buffered)',
        'Unbuffered (Unregistered)', 'LRDIMM'                   # 0C-0Fh
)

function lookUp([string[]]$table, [int]$value)
{
    if ($value -ge 0 -and $value -lt $table.Length) {
        $table[$value]
    } else {
        "Unknown value 0x{0:X}" -f $value
    }
}

function parseTable([array]$table, [int]$begin, [int]$end)
{
    [int]$index = $begin
    $size = [BitConverter]::ToUInt16($table, $index + 0x0C)
    if ($size -eq 0xFFFF) {
        "Unknown memory size"
    } elseif ($size -ne 0x7FFF) {
        if (($size -shr 15) -eq 0) { $size *= 1MB } else { $size *= 1KB }
        # if ([Math]::Floor($size/32768) -eq 0) { $size *= 1MB } else { $size *= 1KB } # For PowerShell < 3.0
    } else {
        $size = [BitConverter]::ToUInt32($table, $index + 0x1C)
    }
    "Size: {0:N0} bytes ({1} GB)" -f $size, ($size/1GB)

    $formFactor = $table[$index + 0x0E]
    $formFactorStr = $(lookUp $FORM_FACTORS $formFactor)
    "Memory form factor: 0x{0:X2} {1}" -f $formFactor, $formFactorStr

    $type = $table[$index + 0x12]
    "Memory type: 0x{0:X2} ({1})" -f $type, $(lookUp $MEMORY_TYPES $type)

    $typeDetail = [BitConverter]::ToUInt16($table, $index + 0x13)
    $details = 0..15 |% {
        if (((1 -shl $_) -band $typeDetail) -ne 0) { "{0}" -f $TYPE_DETAILS[$_] }
        # if (([int]([Math]::Pow(2, $_)) -band $typeDetail) -ne 0) { "{0}" -f $TYPE_DETAILS[$_] } # For PowerShell < 3.0
    }
    "Type detail: 0x{0:X2} ({1})" -f $typeDetail, $($details -join ' | ')

    $speed = [BitConverter]::ToUInt16($table, $index + 0x15)
    if ($speed -eq 0) {
        "Unknown speed"
    } elseif ($speed -ne 0xFFFF) {
        "Speed: {0:N0} MT/s" -f $speed
    } else {
        "Speed: {0:N0} MT/s" -f [BitConverter]::ToUInt32($table, $index + 0x54)
    }
    "======================="
}

$index = 0

$END_OF_TABLES = 127
$MEMORY_DEVICE = 17

$BiosTables = (Get-WmiObject -ComputerName . -Namespace root\wmi -Query `
    "SELECT SMBiosData FROM MSSmBios_RawSMBiosTables" `
).SMBiosData

do
{
    $startIndex = $index

    # ========= Parse table header =========
    $tableType = $BiosTables[$index]
    if ($tableType -eq $END_OF_TABLES) { break }

    $tableLength = $BiosTables[$index + 1]
    # $tableHandle = [BitConverter]::ToUInt16($BiosTables, $index + 2)
    $index += $tableLength

    # ========= Parse unformatted part =========
    # Find the '\0\0' structure termination
    while ([BitConverter]::ToUInt16($BiosTables, $index) -ne 0) { $index++ }
    $index += 2

    # adjustment when the table ends with a string
    if ($BiosTables[$index] -eq 0) { $index++ }

    if ($tableType -eq $MEMORY_DEVICE) { parseTable $BiosTables $startIndex $index }
} until ($tableType -eq $END_OF_TABLES -or $index -ge $BiosTables.length)
phuclv
  • 26,555
  • 15
  • 113
  • 235
  • 1
    This is the only reliable answer that doesnt require third party software and is backed by the specification. Why is this the second lowest answer? – Kevin Groenke Aug 05 '20 at 17:30
  • Does work as advertised. Needs additional info on how to execute. I stored in `c:\tmp\getMemoryInfo.ps1` In Powershell I did the following: `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process` and then `c:\tmp\getMemoryInfo.ps1` The first command was required to allow the execution of an unsigned script. – Oliver Meyer Nov 15 '20 at 13:31
  • @OliverMeyer you don't need to set the execution policy if you copy and paste directly into PowerShell – phuclv Nov 15 '20 at 13:44
  • When I try to run this script in PowerShell, I get “You must provide a value expression on the right-hand side of the '-' operator.” on line 50, char 21 (the first dash in `if (($size -shr 15) -eq 0)`). This is on a very old machine running Windows 7, so probably an ancient version of PowerShell too – could that be why? – Janus Bahs Jacquet Jan 10 '21 at 01:16
  • @JanusBahsJacquet yes, shift operators have only been added [since PowerShell 3.0](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_arithmetic_operators?view=powershell-7.1) while Windows 7 was shipped with PS 2.0. So just replace that right shift by `[math]::floor($size/32767)`. Do the same for the remaining shifts. Can you check the updated code to see if it's working? – phuclv Jan 10 '21 at 02:36
  • @JanusBahsJacquet yes that's a shift-left. You don't need to use floor in this case. And the number should be 32768 for both cases, my bad. I've updated the code in the answer, just copy them out and toggle the comment on the 2 lines with shift – phuclv Jan 10 '21 at 03:01
  • @JanusBahsJacquet fixed the bracket and tested on my PC – phuclv Jan 10 '21 at 03:26
  • 1
    Yes, works like a charm now! – Janus Bahs Jacquet Jan 10 '21 at 03:27
2

While many answers note that wmic is obsolete, you can get the part number right and google that:

wmic memorychip get partnumber

Usually a Google search using just the part number will return several pages where the memory specs are detailed.

Perhaps really old RAM parts will not return useful results, but then wmic should work on these really old RAM sticks.

phuclv
  • 26,555
  • 15
  • 113
  • 235
2

Another alternative you can use, which is free, is Speccy... by the same people who make CCleaner.

It gives you all your hardware specs, as well as temps, voltages, and other data in real time

phuclv
  • 26,555
  • 15
  • 113
  • 235
Pretzel
  • 466
  • 3
  • 17
-1

Open the Command Prompt from the Start menu. You can also press ⊞ Win+R and type cmd to start it.

Type wmic MEMORYCHIP get BankLabel,DeviceLocator,Capacity,Speed and press ↵ Enter

The BankLabel column will tell you which slots the RAM chips are installed in.

phuclv
  • 26,555
  • 15
  • 113
  • 235
  • how is this different from the current top voted answer? And the OP is asking about memory type (DDR2, DDR3, etc.) not about the bank, but wmic command doesn't work for DDR3, DDR4 and up – phuclv Apr 10 '20 at 02:17
-2
  1. Go To Start (Or Ask me anything) and type in Cmd then click on CommandPrompt
  2. In console window type (or paste) wmic MemoryChip

You should get the full information about your RAM

wmic MemoryChip output

phuclv
  • 26,555
  • 15
  • 113
  • 235
Matas Vaitkevicius
  • 1,179
  • 5
  • 21
  • 35
-2

For me, I can't see the voltage of the RAMs on my laptops for some reason using any of the programs mentioned above...

If you have the same problem as me, once you find the part number using cmd (see the picture above by other posts)

wmic memorychip list full

Google the part number, and you shall be able to find more relevant information on your RAM.

Firstly by part no. (eg. HMT451S6AFR8C-PB) the webpage is no longer available but there's cache on google! XD https://webcache.googleusercontent.com/search?q=cache:8vi-pY_TttYJ:https://schreibfehler.eu/w-123/hmt451s6afr8c-pb.html+&cd=1&hl=en&ct=clnk&gl=sg&client=firefox-b

From the webpage I found out the name and maker of the RAM, then I searched again with voltage as search string: "SK HYNIX 4GB 1Rx8 PC3 12800S voltage"

https://www.ebay.com/p/SK-Hynix-4gb-Pc3-12800-Ddr3-204-pin-SODIMM-1-35v-Low-Voltage/664910591

I guess you can try searching directly in ebay as there is a lot of second hand parts on sale on ebay and your ram might just pop up on the list using part no. as the search string.

phuclv
  • 26,555
  • 15
  • 113
  • 235