Last updated on September 28th, 2022 at 09:31 am

WMIC or WMI command line, is another WMI tool found on every computer. This one, similar to wbemtest, as it allows you to query WMI but from a command line. This mean that you can use it within a batch file or other command line software to collect results from WMI. My only issue with it is that its output isn’t as nicely formatted. If I need nicely formatted result then I would use PowerShell for that task.

What is WMIC?

WMIC or WMI command line, is another WMI tool found on every computer. This one, similar to wbemtest, as it allows you to query WMI but from a command line. this mean that you can use it within a batch file or other command line software to collect results from WMI. My only issue with it is that its output isn’t as nicely formatted. If I need nicely formatted result then I would use PowerShell for that task.

WMIC has one advantage over wbemtest. WMIC has both x86 and x64 versions, whereas on an x64 computer, wbemtest is only x64, there is no x86 version. This is were WMIC was useful to me when I was troubleshooting a x86 issue on x64 computer. Wbemtest just would allow me to test a WMI provider as a x86 method. This was important because MECM does any task as x86 even on a x64 computer.

Notice within the screenshot below that wbemtest.exe does NOT exist in c:\windows\syswow64\wbem directory (red arrow) but it does exist within the c:\windows\system32\wbem (green arrow).

If you ever have to track down an issue involving an x86 WMI provider on a x64 computer, then you will need to use WMIC (x86) to troubleshoot the issue.

Why WMIC is Useful

WMI has a number of switch that you can use for a full list, please see the docs.

For example this command line will query OS WMI class. WMIC OS

Results of WMIC for the OS class

Notice that the output is “messy” and hard to read. But it does it job that you need from a command line and therefore is useful within batch file for example.

Hopeful when you need to query WMI via the command line or and x86 process on x64 computer, you will remember this post and user WMIC. If you have any questions, please feel free to touch base @Garthmj.