Solved

Using WMIC to obtain system details, results not as expected

Posted on 2008-10-14
10
4,226 Views
Last Modified: 2013-12-04
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


TotalPhysicalMemory=1571760

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


TotalVirtualMemory=890788

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?
0
Comment
Question by:techieBrandon
  • 6
  • 2
  • 2
10 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 22715219
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 !
0
 
LVL 1

Author Comment

by:techieBrandon
ID: 22731894
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 >

[TpSmry.txt...


*******************************  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  ******************************

...]
0
 
LVL 41

Expert Comment

by:graye
ID: 22740430
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
0
 
LVL 1

Author Comment

by:techieBrandon
ID: 22741565
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:

TotalVirtualMemory=890788

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!
0
 
LVL 1

Author Comment

by:techieBrandon
ID: 22741651
Just FYI, the command:

C:\Documents and Settings\Administrator>systeminfo

results:

[...
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
...]
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 63

Expert Comment

by:SysExpert
ID: 22744692
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.


0
 
LVL 41

Expert Comment

by:graye
ID: 22744747
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)
0
 
LVL 1

Author Comment

by:techieBrandon
ID: 22799235
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
0
 
LVL 1

Author Comment

by:techieBrandon
ID: 22890679
I have not had time to look into this any further, will update ASAP
0
 
LVL 1

Accepted Solution

by:
techieBrandon earned 0 total points
ID: 23283113
I wish I could update this with what I did, but alas, I have forgotten... however my guess is that I used systeminfo
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now