Wmic is not recognized as an internal or external command, operable program or batch file

'wmic' is not recognized as an internal or external command, operable program or batch file. 

I wanted to use wmic today, but it said not there

I checked  the wbem folder but the wmic.exe file wasn't there !!

Please help

View best response

WMIC, or Windows Management Instrumentation Command-Line, is a built-in utility in the Windows operating system that allows you to query, manage, and monitor different systems and network devices on your computer. A regular Windows user can use this tool to obtain information about their computer, such as its serial number, make, model, RAM configuration and capacity, BIOS version, and so much more.

Advertisement

Before being just a command-line tool, WMIC used to provide a complete Graphical User Interface (GUI). However, Microsoft announced that the WMIC UI has been deprecated in Windows 10 version 21H1, and will be deprecated in the following releases as well. This was because it was being superseded by Windows PowerShell for WMI.

That said, the WMI tool is still usable from the Windows command line.

If you are reading this, it is probably because you tried executing a WMIC cmdlet on your system but have ended up with the following error message instead:

WMIC is not recognized as an internal or external command.

This error message does not occur because the tool is deprecated, but it can be due to another reason.

If you see the error stated above, it can be due to 2 primary reasons:

  • The Windows Management Instrumentation service is not running.
  • The environmental variable for WMIC no longer exists.

There could be a third reason, which is corrupted system files on your computer. These can be repaired using DISM and SFC command-line tools.

Let us now discuss how to address the other 2 issues and get the WMIC tool working again.

Enable and Start Windows Management Instrumentation Service

First, make sure that the dependency service for WMIC, which is Windows Management Instrumentation, is running. To do so, follow these steps:

  1. Open the Services console by typing in services.msc in the Run Command box.

    Open the Services console
  2. Scroll down and right-click Windows Management Instrumentation service, then click Properties from the context menu.

    Open service properties
  3. From the Properties window, select Startup Type as Automatic, then click Start. Once the service starts successfully, click Apply and OK to save the changes.

    Enable and start the service

Now check to see if you can run the WMIC cmdlet. If not, then continue to perform the solution given below.

Create Environment Variable for WMIC

As we mentioned above, another reason for the “WMIC not recognized as an internal or external command” is the missing environmental variable. Therefore simply entering the wmic.exe will be insufficient as Windows will not understand which EXE file to run.

You can overcome this problem by either providing the complete path to the WMIC.exe file (given below) or manually creating the environmental variable.

C:\Windows\System32\wbem\WMIC.exe

However, if you choose to enter the complete path, you will need to do so each time you want to run the WMIC tool. Therefore, we suggest that you create the variable to save time and effort in the long run.

  1. Type in sysdm.cpl in the Run Command box to open the System Properties applet.

    Open System Properties
  2. From the System Properties window, switch to the Advanced tab and then click Environmental Variables.

    Open environmental variables
  3. Click New under the System variables section.

    Create new variable
  4. In the pop-up box, type in any custom variable name, and then paste the following path in the text field in front of “Variable value.”

    C:\Windows\System32\wbem\WMIC.exe
    Add variable details

    Once done, click OK.

  5. Now click OK on the Environmental Variables and System Properties windows to close them.

  6. Now restart your computer for the changes to take place.

Once it reboots, you should now no longer experience the same error again.

Final Thoughts

Some people may have been confused, and maybe even upset after hearing that WMIC was deprecated. However, after reading this post, you will have understood that that’s not the case.

Furthermore, some guidelines online even suggest that you reinstall WMIC through the Optional Features available from the Settings app in Windows 11. Let us inform you that the method no longer works, as Microsoft has also removed WMIC from the Optional Features.

Frequently Asked Questions

What is the location of wmic.exe?

The WMIC.exe file is located at C:\Windows\System32\wbem\WMIC.exe.

Is WMIC deprecated?

Yes, WMIC has been deprecated, but just the User Interface. You can still use WMIC in the Windows command line.

Also see:

How do you fix WMIC is not recognized as an internal or external command operable program or batch file?

Open Control Panel > System > Advanced System settings. ... .
Click Environment variables button and select the System Variables section..
Edit Path variable and add C:\Windows\System32\wbem\ to the beginning of the path followed by semicolon ( ";" ) character. ... .
Save the change made to PATH environment variable..

How do you fix CMD is not recognized as an internal or external command?

We have listed fixes for both versions of the error, so follow the relevant one to your case..
Verify if the Program Is Installed. ... .
Use the Full File Path to Execute the Command. ... .
Use the Full File Path Within Double Quotes. ... .
Add the File Path to the Windows Environment Variables. ... .
Move Files to System32 Folder..

How do I install WMIC?

How to: Install software remotely using wmic.
Step 1: Load up a command shell with appropriate access permissions. ... .
Step 2: Step into WMIC. ... .
Step 3: Call the installation (for a single machine) ... .
Step 4: Call the installation (for a list of machines).

How do I run a WMIC command?

How to Run a WMI Query.
Open a command prompt..
Type WMIC to invoke the program, and hit enter..
This will give you the WMIC command prompt, wmic:root\cli>.
From here, you can run WMI queries. The most basic is to return information on the local CPU, which can be done with the following command:.

zusammenhängende Posts

Toplist

Neuester Beitrag

Stichworte