Useful WMI(C) commands

Sometimes you need to run WMI queries on older Windows machines or in Preinstallation Environment (WinPE) environments. So with powershell its really easy, Get-WMIObject -Class win32_WhatYouWant. So now you are stuck without Powershell, lets use the old WMIC command instead. WMIC has been available from Windows 2003.WMIC has alternative WMI names to “simplify” things. But you can with the use of the “path” command use real WMI class names. For instance “wmic path win32_Operatingsystem get InstallDate” will show you the date you installed your computer system.

These are of the ones I use from time to time.

Command What it retrives
wmic COMPUTERSYSTEM get model Retrives the model of the computer hardware.
wmic COMPUTERSYSTEM get manufacturer Retrives the system HW manufacturer.
wmic partition get BlockSize, StartingOffset,Name, Index Information relating to disk HW 
wmic volume get id, blocksize Blocksize selected during formating
wmic csproduct get uuid Shows your computers UUID
wmic OS get LastBootUpTime System boot time
wmic OS get InstallDate System install time
wmic product get name,version Returns installad software and version (Add/remove programs)


Leave a Reply