How do you fix 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

This sneppet guides you on how resolve command prompt or powershell error ‘wmic.exe’ is not recognized as an internal or external command, operable program or batch file.

The WMI command-line (WMIC) utility provides a command-line interface for Windows Management Instrumentation (WMI). WMIC will work well with existing shells and utility commands.

If wmic utility is not found in your PATH, then you might get the following error.

C:\> wmic 'wmic' is not recognized as an internal or external command, operable program or batch file. C:\> echo %PATH% C:\Program Files\Java\openjdk-9.0.4\bin;.;C:\Program Files\apache-maven\bin;.;C:\Program Files\WSO2\Enterprise Integrator.4.0\bin;.;C:\Windows\System32;.;C:\Program Files\nodejs\;C:\Users\nithip\AppData\Roaming\npm

Set wmic.exe utility directory in PATH

To set WMI Command-line (WMIC) utility directory in PATH environment variable, you need to add the following entry C:\Windows\System32\wbem in the PATH.

Note, either you can add this entry via Advanced system settings link -> Environment Variables -> System Variables -> PATH environment variable from control panel in case of Windows 8 and Windows 10, via Computer icon -> Properties -> Advanced system settings -> Environment Variables -> System Variables -> PATH in case of Windows 7 to set path.

(or) 

You can set path via command line as shown below.

C:\> set path=%PATH%;C:\Windows\System32\wbem; C:\> echo %PATH% C:\Program Files\Java\openjdk-9.0.4\bin;.;C:\Program Files\apache-maven\bin;.;C:\Program Files\WSO2\Enterprise Integrator.4.0\bin;.;C:\Windows\System32;.;C:\Program Files\nodejs\;C:\Users\nithip\AppData\Roaming\npm;C:\Windows\System32\wbem; C:\> wmic wmic:root\cli >

Using WMIC.exe help utility

Windows Management Instrumentation (WMI) is the Microsoft implementation of Web-Based Enterprise Management (WBEM), which is an industry initiative to develop a standard technology for accessing management information in an enterprise environment.

WMI uses the Common Information Model (CIM) industry standard to represent systems, applications, networks, devices, and other managed components.

WMIC includes online help at the command line. First, at the command prompt type wmic to start the WMIC shell and then type /? at any level to display list of alias and syntax.

C:\> wmic wmic:root\cli>/? [global switches] <command> The following global switches are available: /NAMESPACE Path for the namespace the alias operate against. /ROLE Path for the role containing the alias definitions. /NODE Servers the alias will operate against. /IMPLEVEL Client impersonation level. /AUTHLEVEL Client authentication level. /LOCALE Language id the client should use. /PRIVILEGES Enable or disable all privileges. /TRACE Outputs debugging information to stderr. /RECORD Logs all input commands and output. /INTERACTIVE Sets or resets the interactive mode. /FAILFAST Sets or resets the FailFast mode. /USER User to be used during the session. /PASSWORD Password to be used for session login. /OUTPUT Specifies the mode for output redirection. /APPEND Specifies the mode for output redirection. /AGGREGATE Sets or resets aggregate mode. /AUTHORITY Specifies the <authority type> for the connection. /?[:<BRIEF|FULL>] Usage information. For more information on a specific global switch, type: switch-name /? The following alias/es are available in the current role: ALIAS - Access to the aliases available on the local system BASEBOARD - Base board (also known as a motherboard or system board) management. BIOS - Basic input/output services (BIOS) management. BOOTCONFIG - Boot configuration management. CDROM - CD-ROM management. COMPUTERSYSTEM - Computer system management. CPU - CPU management. CSPRODUCT - Computer system product information from SMBIOS. DATAFILE - DataFile Management. DCOMAPP - DCOM Application management. DESKTOP - User's Desktop management. DESKTOPMONITOR - Desktop Monitor management. DEVICEMEMORYADDRESS - Device memory addresses management. DISKDRIVE - Physical disk drive management. DISKQUOTA - Disk space usage for NTFS volumes. DMACHANNEL - Direct memory access (DMA) channel management. ENVIRONMENT - System environment settings management. FSDIR - Filesystem directory entry management. GROUP - Group account management. IDECONTROLLER - IDE Controller management. IRQ - Interrupt request line (IRQ) management. JOB - Provides access to the jobs scheduled using the schedule service. LOADORDER - Management of system services that define execution dependencies. LOGICALDISK - Local storage device management. LOGON - LOGON Sessions. MEMCACHE - Cache memory management. MEMORYCHIP - Memory chip information. MEMPHYSICAL - Computer system's physical memory management. NETCLIENT - Network Client management. NETLOGIN - Network login information (of a particular user) management. NETPROTOCOL - Protocols (and their network characteristics) management. NETUSE - Active network connection management. NIC - Network Interface Controller (NIC) management. NICCONFIG - Network adapter management.

Further, to display options available for specific alias let’s say process, you need type the following from WMIC CLI.

wmic:root\cli>process/? PROCESS - Process management. HINT: BNF for Alias usage. (<alias> [WMIObject] | <alias> [<path where>] | [<alias>] <path where>) [<verb clause>]. USAGE: PROCESS ASSOC [<format specifier>] PROCESS CALL <method name> [<actual param list>] PROCESS CREATE <assign list> PROCESS DELETE PROCESS GET [<property list>] [<get switches>] PROCESS LIST [<list format>] [<list switches>]

Also See:

  • Set Windows PowerShell Environment Variables
  • How to change drive and the directory in Windows PowerShell ?
  • Visual Studio Code change Terminal from powershell to cmd
  • Not recognized as an internal or external command ‘ionic’

References:

  • wmic
  • microsoft docs

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

If you already have MinGW installed in Windows 7, just simply do the following: Make another copy of C:\MinGW\bin\mingw32-make.exe file in the same folder. Rename the file name from mingw32-make.exe to make.exe . Run make command again.

How do I install WMIC on Windows?

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 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&gt;.
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:.

What command replaces WMIC?

"The WMIC tool is deprecated in Windows 10, version 21H1 and the 21H1 General Availability Channel release of Windows Server. This tool is superseded by Windows PowerShell for WMI," explains the list of deprecated Window features.