Skip to content
Windows 🟡 Intermediate

Fix the ‘WMIC’ Is Not Recognized Error in Windows 11

Richard
Written by
Richard
7 min read
Windows 11 Settings Optional features page beside a Command Prompt window, illustrating how to fix the WMIC not recognized error.
Windows 11 Settings Optional features page beside a Command Prompt window, illustrating how to fix the WMIC not recognized error.
Before you start
  • 2 steps
  • Needs administrator rights

The “‘wmic’ is not recognized as an internal or external command” error in Windows 11 means the WMIC command-line tool is not installed on your PC, or Windows cannot find it. The quickest fix is to add WMIC back under Settings System Optional features, then open a new terminal window and run your command again.

WMIC (Windows Management Instrumentation Command-line) is an older tool that reads hardware and system details such as serial numbers and disk models. Microsoft has deprecated it, which means it is being phased out and may be removed in later versions. It is now an optional feature in current Windows 11 versions (24H2 and 25H2), so it may be missing from a new or upgraded PC.

This guide shows how to check the cause, install WMIC, fix a broken search path, and switch to PowerShell if WMIC is not available on your Windows version.

⚡ Quick Answer

To fix the “‘wmic’ is not recognized” error in Windows 11, install WMIC as an optional feature. Open Settings, go to System Optional features, select View features next to Add an optional feature, tick WMIC, and select Add. Then close all Command Prompt and PowerShell windows, open a new Terminal, and run your command again.

Advertisement

Why Windows 11 Says WMIC Is Not Recognized

The message appears when Command Prompt or PowerShell cannot find wmic.exe. There are three common causes:

  • The WMIC feature is not installed. Windows 11 treats WMIC as a Feature on Demand (an optional component that downloads only when needed). It can be off by default on clean installs of version 24H2 and later.
  • The PATH is broken. The PATH is the list of folders Windows searches when you type a command name. If the folder that holds wmic.exe is missing from that list, the command fails even though the file exists.
  • The window is out of date. A terminal window opened before you installed WMIC does not see the new tool until you open a fresh one.

The exact wording depends on where you type. Command Prompt says 'wmic' is not recognized as an internal or external command, operable program or batch file. PowerShell says The term 'wmic' is not recognized as the name of a cmdlet, function, script file, or operable program. Both point to the same problem.

Advertisement

Check Whether WMIC Is Installed

This test tells you which fix you need, so you do not change settings you do not have to. It does not modify anything.

  1. Right-click the Start button and select Terminal. A Windows Terminal window opens, usually in PowerShell.
  2. Type the command below and press Enter.
💻Code
C:\Windows\System32\wbem\wmic.exe /?

This command assumes Windows is installed on drive C. Check the result:

  • If you see a help screen listing WMIC options, WMIC is installed and only the PATH is wrong. Go to the section “Repair a Broken PATH for WMIC” below.
  • If Windows says it cannot find the file or path, WMIC is not installed. Continue with the next section.

Add the WMIC Feature Back in Windows 11

📝Good to KnowThese steps fix the “‘wmic’ is not recognized” error by installing WMIC as an optional feature. This step needs administrator privileges. If you sign in with a standard account (one without administrator rights), Windows asks for an administrator password during the install.
Advertisement
  1. Press Windows key + I. The Settings app opens.
    Windows 11 Start menu search panel for opening OpenSSH Client settings
    Windows 11 Start menu search panel for opening OpenSSH Client settings
  2. Select System in the left pane. The System page lists Display, Sound, Notifications, and more.
    Settings › System
    Settings › System
  3. Scroll down and select Optional features. The page shows the features already installed on your PC.
    Settings › System › Optional features
    Settings › System › Optional features
  4. Select View features next to Add an optional feature. A window opens with a list of features you can add.
  5. Type WMIC in the search box. The list narrows to matching entries.
  6. Tick the check box next to the WMIC entry. If nothing appears, read “If WMIC Is Not in the Optional Features List” below.
  7. Select Next. Windows shows a summary of what it will install.
  8. Select Add. Windows downloads and installs the feature, so you need an internet connection. Progress appears on the Optional features page.
  9. Wait until the install finishes. It usually takes a short time. A restart is not normally required, but restart the PC if the command still fails after the last step.
  10. Close every open Command Prompt, PowerShell, and Terminal window. Old windows do not pick up the new tool.
  11. Right-click the Start button and select Terminal. A new window opens.
  12. Type wmic /? and press Enter. A list of WMIC options appears instead of the error. Now run your original command.

If the install fails with an error code, check that the PC is online and that Windows Update is not stuck. Then repeat steps 4 to 8. Optional features download through Windows Update, so a blocked update service also blocks this install.

For more on adding and removing the feature, including other ways to do it, see How to Add or Remove WMIC Command Feature in Windows 11.

If WMIC Is Not in the Optional Features List

Windows 11 versions differ in how they offer WMIC, and I could not confirm from Microsoft’s current documentation which Windows 11 builds offer WMIC. If the search in step 5 returns nothing, take these checks in order:

  • Open Settings Windows Update and install all pending updates. Then search the list again.
  • Look under Settings System Optional features first. If WMIC already appears in the installed list, it is installed, and the problem is the PATH or an old window.
  • If WMIC is still unavailable, treat it as retired on your Windows version (build number) and move to PowerShell. The section “Replace WMIC Commands With PowerShell” covers the common commands.
Advertisement

Avoid third-party download sites for wmic.exe. Someone may have altered a copied file, and it may not match your Windows build.

Repair a Broken PATH for WMIC

Use this fix only if the check in “Check Whether WMIC Is Installed”, C:\Windows\System32\wbem\wmic.exe /?, showed the help screen, but the bare wmic command still fails. Editing the system PATH affects every program on the PC, so change only what these steps describe. These steps need administrator privileges.

  1. Select the Start button, type Edit the system environment variables, and open the result. A System Properties window opens on the Advanced tab.
  2. Select Environment Variables. A window opens with two lists, User variables on top and System variables below.
  3. Select Path in the System variables list, then select Edit. A list of folders appears.
  4. Look for an entry that reads %SystemRoot%\System32\Wbem. Do not change other entries.
  5. If the entry is missing, select New and type the line below exactly.
💻Code
%SystemRoot%\System32\Wbem
  1. Select OK in each open window to save the change. The windows close.
  2. Open a new Terminal window and type wmic /?. The help screen appears if the PATH is now correct.
Advertisement

To undo this change, return to the same Path list, select the entry you added, and select Delete.

Replace WMIC Commands With PowerShell

💡TipMicrosoft is moving away from WMIC, so PowerShell is the more reliable long-term choice. PowerShell uses Get-CimInstance, a command that reads the same system data WMIC reads. It works on every current Windows 11 build without installing anything.

These examples cover the WMIC commands people run most often. Type them in Terminal.

⬛PowerShell
wmic bios get serialnumber
Get-CimInstance Win32_BIOS | Select-Object SerialNumber
⬛PowerShell
wmic cpu get name
Get-CimInstance Win32_Processor | Select-Object Name
⬛PowerShell
wmic os get caption,version
Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version
⬛PowerShell
wmic diskdrive get model,serialnumber
Get-CimInstance Win32_DiskDrive | Select-Object Model, SerialNumber
⬛PowerShell
wmic logicaldisk get name,size,freespace
Get-CimInstance Win32_LogicalDisk | Select-Object DeviceID, Size, FreeSpace

In each pair, the first line is the old WMIC command and the second is the PowerShell version. Run only the second line. PowerShell prints the results as a table, and sizes appear in bytes.

Advertisement

If a batch file or script of your own calls wmic, it produces the same error on any PC without the feature. Either install WMIC on that PC or rewrite the line with the PowerShell equivalent. The rewrite is the better fix if you share the script with others, since you cannot count on WMIC being present.

Remove WMIC Again

If you installed WMIC only to run one command and want it gone, open Settings System Optional features, find WMIC in the installed features list, select it, and choose Uninstall. Windows removes the tool without affecting other features. The WMIC add and remove guide covers this in more detail.

What to Do Next

Run wmic /? in a fresh Terminal window. If the help screen appears, your original command now works. If the error comes back after a feature update or a clean reinstall, add WMIC again under Optional features, because those changes can reset the optional feature list. For anything you plan to keep using, move the command to PowerShell with Get-CimInstance, since WMIC is deprecated and may not be offered on future builds.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Tags: #Windows 11

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked * How we handle comments