1

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
4
  • 2
    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, 2012 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?
    – AabinGunz
    Jun 21, 2012 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, 2012 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?
    – AabinGunz
    Jun 21, 2012 at 7:40

2 Answers 2

3

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .