WMIC

Also known as: Windows Management Instrumentation Command-line

On this page 7

WMIC, the Windows Management Instrumentation Command-line, is a console utility that exposes Windows Management Instrumentation (WMI) classes through short commands, letting administrators query hardware, processes, services and installed software from the Command Prompt. In the PowerShell & command line toolset of Windows, it was for two decades the quickest way to read system data in scripts and batch files.

Microsoft deprecated WMIC in Windows 10 version 21H1, turned it into an optional feature in later Windows 11 releases and removed it starting with Windows 11 version 25H2. The WMI service itself remains, so the same data is now reached through PowerShell CIM cmdlets.

How WMIC translates commands into WMI queries

WMIC works as a thin front end to the WMI repository: each command is converted into a WMI Query Language (WQL) request against a class in a namespace, by default root\cimv2. The general form is wmic [global switches] alias [where clause] verb, where an alias is a friendly name mapped to a WMI class.

For example, wmic os get Caption,Version reads the Win32_OperatingSystem class, and wmic process where "name='notepad.exe'" call terminate runs a method on matching objects. Results can be formatted as a table, list, CSV or XML with the /format switch, which made WMIC popular for inventory scripts that wrote text files for later parsing.

The table below lists frequently used aliases and the WMI classes behind them.

AliasWMI classTypical query
osWin32_OperatingSystemEdition, build and last boot time
biosWin32_BIOSFirmware version and serial number
cpuWin32_ProcessorModel, cores and clock speed
logicaldiskWin32_LogicalDiskDrive letters and free space
processWin32_ProcessRunning processes and command lines
serviceWin32_ServiceService state and start mode
qfeWin32_QuickFixEngineeringInstalled updates
Common WMIC aliases

Verbs and global switches

A WMIC verb defines the action performed on the selected objects, while global switches change the context, such as the target computer or the output file. Combining them allowed one-line remote administration long before PowerShell remoting was common.

ElementExampleEffect
getwmic bios get SerialNumberReturns selected properties
listwmic service list briefReturns predefined property sets
callwmic service where name=’Spooler’ call StopServiceInvokes a class method
/nodewmic /node:PC01 os get CaptionTargets a remote computer over DCOM
/formatwmic cpu get Name /format:csvChanges the output format
/outputwmic /output:inv.txt qfe listWrites results to a file
Main verbs and switches

Remote calls with /node use DCOM over RPC, which needs dynamic ports and firewall exceptions. This dependency is one reason administrators moved to WinRM-based tools, which use a single, more easily controlled port.

Why WMIC was retired

Microsoft retired WMIC because PowerShell provides the same WMI access with structured objects, better remoting and active development. WMIC returns plain text that scripts must parse, and its alias set was never expanded to cover newer namespaces such as storage or Hyper-V.

Security was a second driver. WMIC is a signed system binary that attackers frequently abused as a living-off-the-land tool for reconnaissance, lateral movement and process creation on remote hosts. Removing it shrinks the attack surface and reduces noise for detection rules, although WMI itself remains reachable through other interfaces.

The retirement happened in stages, which explains why the same command behaves differently across a mixed fleet. Organizations that cannot migrate immediately can temporarily reinstall the optional feature on builds that still offer it, but this only postpones the work, and security baselines increasingly flag its presence. Detection teams also benefit: once the binary is gone, any attempt to run it becomes a high-confidence signal worth investigating.

PowerShell replacements for WMIC commands

The direct successors are the CIM cmdlets, introduced in PowerShell 3.0, which query the same classes and return objects that can be filtered, sorted and exported without text parsing. The older Get-WmiObject cmdlet still exists in Windows PowerShell 5.1 but is not available in PowerShell 7.

This mapping helps when converting legacy batch files.

WMIC commandPowerShell equivalentNotes
wmic os get CaptionGet-CimInstance Win32_OperatingSystemReturns a full object
wmic bios get SerialNumber(Get-CimInstance Win32_BIOS).SerialNumberProperty access by name
wmic process call createInvoke-CimMethod Win32_Process -MethodName CreateArguments as a hashtable
wmic /node:PC01Get-CimInstance -ComputerName PC01Uses WinRM by default
wmic qfe listGet-HotFixDedicated cmdlet
/format:csvExport-CsvStructured export
WMIC commands and their PowerShell equivalents

For environments that still require DCOM, a CIM session with DCOM options can be created with New-CimSessionOption -Protocol Dcom, which preserves compatibility while removing the WMIC dependency.

Pitfalls when using or replacing WMIC

  • Querying Win32_Product: wmic product triggers a consistency check of every MSI package, which is slow and can start repairs. Read the uninstall registry keys instead.
  • Quoting in where clauses: nested quotes behave differently in Command Prompt and PowerShell, so commands copied between shells often fail.
  • Locale-dependent output: text columns and date formats vary, which breaks parsers; CIM objects return typed values such as DateTime.
  • Silent absence on new builds: scripts fail with a not-recognized error where the optional feature is missing, so test for the binary or migrate first.
  • Assuming WMI is gone: only the command-line tool was removed; the WMI service, providers and repository remain fully supported.

Before upgrading a fleet, administrators should search scripts and scheduled tasks for the string wmic, including calls hidden in installers and monitoring agents, because these breakages surface only after the upgrade.

The idea in brief

Windows keeps a detailed internal catalog of the computer: its processor, disks, programs, running tasks and much more. WMIC was a simple typed command for asking that catalog questions, such as which version of Windows is installed or what the serial number is.

It was handy, but its answers came back as plain text, and attackers liked it too. Microsoft has therefore phased it out in favor of PowerShell, which asks the same catalog the same questions and returns tidier, more reliable answers. The catalog stays; only the old way of asking is going away.

A practical scenario

An IT technician at a regional accounting firm maintains a logon batch file, written years ago, that runs wmic bios get SerialNumber and wmic os get Caption and appends the results to a shared inventory file. After a pilot group upgrades to Windows 11 version 25H2, their entries stop appearing, and the log shows that wmic is not recognized.

The technician replaces the batch file with a short PowerShell script that calls Get-CimInstance for Win32_BIOS and Win32_OperatingSystem, builds one object per computer and writes it with Export-Csv. The new script works on all 140 workstations, both old and new builds, and the CSV no longer needs manual cleanup because the values arrive as clean, typed properties instead of padded text columns.