Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using WMIC to obtain system details, results not as expected

Posted on 2008-10-14
10
Medium Priority
?
4,302 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
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!

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

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

963 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