Accessing WMI from cmd.exe

At the core of Windows is something called WMI – Windows Management Instrumentation. It gives access to a wide range of information about your machine, both hardware and software. After browsing through a very interesting thread over at serverfault.com I discovered a DOS command I hadn’t seen before. wmic.exe.

Wmic.exe is a console application for querying WMI for data, and it has a lot of nice features. It comes with Windows, so it’s allready on your machine. Take a look at this:

C:\>wmic bios get name
Name
BIOS Date: 12/10/08  Ver: 6AET52WW (1.18)

That actually gives you the BIOS version – from DOS!

How about some information about your CPU?

wmic
C:\>wmic cpu get /all /value

That gives back a ton of information about your CPU, like the Name, how many logical processors there are, what kind of socket it has, its voltage, the current load (in percent) and a whole lot more. This next command indicated if you have a 32- or 64-bit OS. Note, a 32-bit OS installed on a 64-bit CPU will list itself as 32-bit.

C:\>wmic cpu get datawidth
DataWidth
64

The information can be listed as a two column list, or even formatted as HTML. This command will create a html file with information about your desktop monitor, and open the file.

C:\>wmic desktopmonitor get /all /format:htable >> desktopinfo.html
C:\>start desktopinfo.html

Need info about your network cards?

C:\>wmic nic get Name, MACAddress
(lists all the network cards and their MAC addresses).

You can get info about the motherboard, about the software products installed, about your NT-domain, your printers….and the list just goes on and on. Go figure out for yourself all the other goodies this application have to offer by using:

C:\>wmic /?

Enjoy, I know I will!

wmic2

Leave a Reply