Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use a couple of wmic commands and I was wondering how can a user come to know the the unit of any size related command output?

For Instance I use the below 2 commands

  1. wmic /node:Abhishek-PC cpu get maxclockspeed,l2cachesize,loadpercentage

    output:

    L2CacheSize  LoadPercentage  MaxClockSpeed
    8192         1               1595
    8192         1               1595
  2. wmic /node:Abhishek-PC LogicalDisk Where DriveType="3" Get DeviceID,Size,FreeSpace

    output:

    DeviceID  FreeSpace    Size
    C:        13933780992  73300701184
    E:        23688204288  73405558784
share|improve this question
1  
The L2CacheSize is in KB. The MaxClockSpeed is in MHz. The FreeSpace and Size are in bytes. There doesn't seem to be any consistency between them. –  user3463 Jun 21 '12 at 7:32
    
@RandolphWest: as you FreeSpace and Size are in bytes so these info will always be in bytes? Or does it vary in different computers? –  Abhishek Simon Jun 21 '12 at 7:35
    
It's in bytes on mine. However, there's no guarantee that Microsoft will keep it this way in future versions. I looked in the MSDN documentation now, and all I found was templates for exporting to XML, but nothing about how it's decided. –  user3463 Jun 21 '12 at 7:38
    
@RandolphWest: I am actually running these commands from a java program, and making a xml out of it which further goes to a webpage. So my concern is to display these information with their proper units, any help how this could be achieved? –  Abhishek Simon Jun 21 '12 at 7:40
add comment

2 Answers

up vote 2 down vote accepted

WMIC has some built in aliases that are sort of "nick names" to real WMI classes, like win32_processor. Later has documentation online and I would suggest using it (or common sense) to translate WMI-units to Human-Readable units.

To find out what each alias point to - use wmic alias command e.g.:

wmic alias cpu

... would tell you the name of the WMI class used when you do wmic cpu Next thing you do is ask (you favorite search engine) and get answers: Win32_Processor (alias: cpu) Win32_LogicalDisk (alias: logicaldisk)

You can also use:

wmic alias list brief

.. to get information about all aliases in one step.

share|improve this answer
add comment

I'm going to make an educated guess here, that because it's WMI, it's version- or platform- specific.

Based on Microsoft's past history, the units will probably stay the same, but there's no guarantee this is the case.

Your challenge is really based on the fact that WMI talks to so many components, and the respective manufacturers could report the numbers differently in the future.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.