Fix “wmic is not recognized” on Windows 11
“wmic Is Not Recognized” in Windows 11? Here’s What Happened and How to Fix It
You typed a command that has worked for fifteen years:
C:\> wmic bios get serialnumber
'wmic' is not recognized as an internal or external command,
operable program or batch file.
Your first instinct is probably that something is broken. Nothing is broken. Microsoft removed WMIC from Windows. Microsoft has removed it in stages: it was disabled by default on Windows 11 23H2 and 24H2 in 2024, removed entirely when you upgrade to 25H2, and as of the August 2026 update it has been pulled from every currently supported Windows 11 version — including 24H2 — and is no longer offered as a Feature on Demand at all (source: Microsoft Support, “WMIC removal from Windows”).
So if you’ve recently updated to 24H2 or set up a new machine, every script and muscle-memory command built on wmic just stopped working. Pulling a laptop’s serial number for an asset inventory is probably the most common way people discover it.
The good news: everything WMIC did, PowerShell does better, and it’s already installed. Let’s fix your immediate problem first, then cover the replacements you’ll actually want going forward.
Solution 1: Use PowerShell Instead (Recommended)
Nothing to install, works on every supported version of Windows. For the serial number specifically:
Get-CimInstance Win32_BIOS | Select-Object SerialNumber
Run that in PowerShell and you get:
SerialNumber
------------
5CD1234XYZ
Still living in Command Prompt? You can call PowerShell inline from cmd, which is also the drop-in fix for old batch files:
powershell -command "Get-CimInstance Win32_BIOS | Select-Object SerialNumber"
That’s the two-minute fix. But since WMIC isn’t coming back, it’s worth learning the pattern — because it converts every WMIC command you know.
The Pattern: Translating Any WMIC Command to PowerShell
Here’s the part that makes this genuinely easy: WMIC and PowerShell’s Get-CimInstance query the same underlying WMI classes. wmic bios was always just a shorthand for the Win32_BIOS class. So the translation is mechanical:
wmic <alias> get <property>becomesGet-CimInstance Win32_<Class> | Select-Object <Property>
A conversion table for the WMIC commands sysadmins actually use:
| What you want | Old WMIC command | PowerShell replacement |
|---|---|---|
| BIOS serial number | wmic bios get serialnumber | Get-CimInstance Win32_BIOS | Select SerialNumber |
| PC model & manufacturer | wmic csproduct get name,vendor | Get-CimInstance Win32_ComputerSystemProduct | Select Name,Vendor |
| Motherboard details | wmic baseboard get product,manufacturer | Get-CimInstance Win32_BaseBoard | Select Product,Manufacturer |
| CPU info | wmic cpu get name,numberofcores | Get-CimInstance Win32_Processor | Select Name,NumberOfCores |
| OS version & install date | wmic os get caption,installdate | Get-CimInstance Win32_OperatingSystem | Select Caption,InstallDate |
| Installed RAM sticks | wmic memorychip get capacity,speed | Get-CimInstance Win32_PhysicalMemory | Select Capacity,Speed |
| Disk drives | wmic diskdrive get model,size | Get-CimInstance Win32_DiskDrive | Select Model,Size |
| Running processes | wmic process list brief | Get-Process |
| Logical disks / free space | wmic logicaldisk get name,freespace | Get-CimInstance Win32_LogicalDisk | Select Name,FreeSpace |
Two upgrades you get for free with the PowerShell versions: the output is real objects, not text (so you can sort, filter, and export without parsing), and remote queries are built in — add -ComputerName SERVER01 to run the same query against another machine.
Bonus one-liner worth keeping — a mini hardware inventory that grabs serial, model, and manufacturer together:
Get-CimInstance Win32_ComputerSystemProduct | Select-Object Vendor, Name, IdentifyingNumber
(IdentifyingNumber here is the same serial number — handy when Win32_BIOS returns blank on some OEM machines.)
Solution 2: Bringing WMIC Back (Only Works on Older Builds)
Sometimes rewriting isn’t an option today — you’ve got a legacy vendor script, an old deployment tool, or third-party software that shells out to wmic internally. On older builds that have not yet received the removal, WMIC can still be added back as a Feature on Demand. On a fully updated Windows 11 24H2 or 25H2 machine this option is gone, so if the steps below show no WMIC entry, you cannot restore it and the only fix is Solution 1:
- Open Settings → System → Optional features
- Click View features (next to “Add an optional feature”)
- Search for WMIC, tick the checkbox, click Next → Add
- Close and reopen your Command Prompt once installation finishes
Or do it in one line from an elevated PowerShell, which is the sane option when you need it on many machines:
Add-WindowsCapability -Online -Name "WMIC~~~~"
Treat this as a short bridge at most. The optional feature has now been withdrawn from every currently supported Windows 11 version, so any script that still calls wmic will break once that machine receives the update that removes it. Re-enable it to keep a legacy process alive, but put “migrate that script to Get-CimInstance” on the backlog with a real date on it.
Solution 3: Check Your PATH (Older Windows Only)
If you’re on Windows 10 or an early Windows 11 build — where WMIC definitely still exists — and you’re getting this error anyway, the problem is different: your PATH environment variable is missing the WBEM directory. Quick test — call it by full path:
C:\Windows\System32\wbem\wmic.exe bios get serialnumber
If that works, the fix is adding the directory back: System Properties → Environment Variables → Path (System variables) → Edit → New and add:
C:\Windows\System32\wbem
Open a fresh Command Prompt afterwards (existing windows keep the old PATH). This scenario is rare and usually traces back to an installer or script that overwrote the system PATH — but it’s worth ruling out before assuming your Windows version dropped WMIC.
Which Solution Should You Use?
The honest decision tree is short. Interactive use or anything new you’re writing: PowerShell, no exceptions — WMIC is deprecated and building anything new on it is creating tomorrow’s breakage. A legacy script you can’t touch right now: on an older build, re-enable the optional feature and keep that machine from updating only as long as you must, but treat the migration as urgent, because on current builds the feature is no longer available. Windows 10 / pre-24H2 with the error: it’s your PATH, not a missing tool.
The bigger takeaway, if you’re a sysadmin: this is part of a pattern. Microsoft has been steadily retiring the classic text-based utilities in favour of PowerShell’s object pipeline — WMIC is just the highest-profile casualty so far. Every WMIC habit you convert to Get-CimInstance now is one less 2 a.m. surprise on the next Windows upgrade.
FAQ
Why did Microsoft remove WMIC?
WMIC was a 2000-era text wrapper around WMI with a long history of security abuse — it became a favourite living-off-the-land tool for malware. PowerShell’s Get-CimInstance covers the same functionality with structured output and modern remoting (WinRM), so Microsoft deprecated the wrapper. WMI itself is not going anywhere; only the old command-line tool is.
Is wmic available in Windows 11 24H2?
Not by default. It ships as a disabled optional feature (“Feature on Demand”) that you can re-enable via Settings → System → Optional features, or with Add-WindowsCapability.
What is the direct replacement for wmic bios get serialnumber?
Get-CimInstance Win32_BIOS | Select-Object SerialNumber in PowerShell — or wrap it as powershell -command "..." if you’re calling it from a batch file.
Get-WmiObject or Get-CimInstance — which should I use?
Get-CimInstance. The older Get-WmiObject still works in Windows PowerShell 5.1 but is itself deprecated and doesn’t exist in PowerShell 7. Same classes, same queries — just the newer cmdlet.
Will re-enabling WMIC survive Windows updates?
For now, yes — but Microsoft has stated WMIC will eventually be removed entirely, so a feature update could take it away. Treat re-enabling as a temporary compatibility measure while you migrate scripts.
Keep reading
- Get-WmiObject Is Not Recognized in PowerShell 7: Use Get-CimInstance — The PowerShell side of the same change.
- Windows Boot Process Step by Step (and How to Fix Each Stage) — Another Windows problem solved by knowing what happens under the hood.
- Top 5 Windows Security Tips to Protect Your PC From Malware — Basic hardening steps for any Windows 10 or 11 PC.
- How to Enable BitLocker in Windows 10 and 11 (Step by Step) — Turn on drive encryption in Windows 10 and 11.
