Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4308
  • Last Modified:

Using WMIC to obtain system details, results not as expected

I am working on using Window's WMIC to obtain the total physical memory and total virtual memory (along with numerous other things). I get the expected total physical memory using:

C:\Documents and Settings\Administrator>wmic MemLogical get TotalPhysicalMemory /Value


This looks roughly about right since I have 1.5 GB of RAM on this machine. The problem is when I look for my total virtual memory I get:

C:\Documents and Settings\Administrator>wmic MemLogical get TotalVirtualMemory /Value


My Virtual Memory Settings:

Space available: 11738

Custom size:
Initial size: 2046
Max size: 4092

Total paging file size for all drives:
Min allowed: 2 MB
Recommended: 2301 MB
Currently allocated: 2046 MB

I cannot figure out what is being returned upon my total virtual memory request. Thus far I have not been able to find solid documentation on WMIC though I have found a few sources, none authoritize though. I noticed that VB has replicated this functionality at http://msdn.microsoft.com/en-us/library/esy1c522.aspx which states that the return is in bytes, however when doing the conversions I cannot figure out what the returned value trully represents.

Anyone have further insight, references?
  • 6
  • 2
  • 2
1 Solution
What does winmsd show you ? ( sysinfo32 )

You might find that you get more info there, and it can be run to create a test report with lots of relevant info.

Works on win98 and newer.

I hope this helps !
techieBrandonAuthor Commented:
Thanks for the response, sorry for my delay.

I did some trials with winmsd but it does not output the virtual memory, or processor speed, in other regards a good tool though.

C:\Documents and Settings\Administrator>winmsd /a /f > 


*******************************  SYSTEM SUMMARY  *******************************
OS information: Microsoft Windows XP
OS version: 5.10.2600   Service Pack 2
Processor: x86 Family 6 Model 9 Stepping 5
Memory: 1,571,760 kb
BIOS version: 3.16  (1RETDKWW)
Machine type-Model: 23738U2

******************************  BIOS INFORMATION  ******************************

It looks like you're trying to get to the TotalPageFileSpace (the amount of Physical Page file + the amount of Physical Ram).   Is that correct?   If so, then just use:
    wmic MemLogical get TotalPageFileSpace /Value
The documentation for these values is at:  http://msdn.microsoft.com/en-us/library/aa394181.aspx
Note:  There is a comment in the documentation that says that these values are no longer supported and to use another value instead.   But it seems to still work for me
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

techieBrandonAuthor Commented:
Hi grave, thanks for the response.

What I am looking for is the virtual memory configured for the current operating system. The command would be:

wmic MemLogical get TotalVirtualMemory /Value

The problem I am having is the result, which is:


I am unsure what this 890788 is measured in, kb or byte I would assume but doing the math it doesn't fit with what I would expect on this machine.

I will have a look at the site you linked shortly. Thanks!
techieBrandonAuthor Commented:
Just FYI, the command:

C:\Documents and Settings\Administrator>systeminfo


Total Physical Memory:     1,535 MB
Available Physical Memory: 58 MB
Virtual Memory: Max Size:  2,048 MB
Virtual Memory: Available: 1,996 MB
Virtual Memory: In Use:    52 MB
depends on the OS.

IN XP it does show RAM, CPU speed and a bunch of other stuff by category

try winmsd /report filename.txt
also called msinfo32 on XP and newer.

Well... it's quite possible that the reason that you're getting bad informatio from the Win32_LogicalMemoryConfiguration class is because it's no longer supported.
Recall that I mentioned that the documentation suggests that you discontinue using Win32_LogicalMemoryConfiguration  (which uses the alias of "MemLogical" in WMIC) and instead use similar fields from the Win32_OperatingSystem class (which uses the alias of "OS" in WMIC)
techieBrandonAuthor Commented:
Hey, thanks to both of you for quick response, sorry mine haven't been as prompt.

I will give both a shot this afternoon and see what works and make another post later. Thanks again
techieBrandonAuthor Commented:
I have not had time to look into this any further, will update ASAP
techieBrandonAuthor Commented:
I wish I could update this with what I did, but alas, I have forgotten... however my guess is that I used systeminfo

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now