Windows Management Instrumentation Command-line (WMIC) utility
What is the Windows Management Instrumentation Command-line (WMIC) utility?
The Windows Management Instrumentation Command-line (WMIC) utility is a command-line interface for working with Windows Management Instrumentation (WMI), a framework for managing data and operations on a Windows computer.
Microsoft deprecated the WMIC utility beginning with versions 21H1 of Windows 10 and Windows Server. It has been superseded by Windows PowerShell for WMI. However, only the WMIC utility has been deprecated; WMI remains unchanged.
How does WMI work?
WMI is the Microsoft implementation of Web-Based Enterprise Management, which is a set of management specifications for enterprise computing environments. WMI is also based on the Common Information Model (CIM), a computer industry standard for representing systems, devices, applications and other managed components. The CIM standard lets system administrators and management programs control devices and applications from multiple manufacturers or sources in the same way.
WMI provides users with information about the status of local or remote computer systems and supports the following actions:
- Configuring security settings.
- Setting and changing system properties.
- Setting and changing permissions for authorized users and user groups.
- Assigning and changing drive labels.
- Scheduling processes to run at specific times.
- Backing up the object repository.
- Enabling or disabling error logging.
The WMIC utility provides an interface to WMI that makes it easy to access information and perform administrative functions.
WMIC operates in two modes: interactive and noninteractive. Noninteractive mode is commonly used because it can be invoked at a Terminal command prompt just like other commands. This mode is useful for carrying out one-off tasks or when including WMIC commands in a batch file. A user can invoke noninteractive mode by preceding the WMIC command with the utility's name. For example, Figure 1 shows a WMIC command at a command prompt in Windows Terminal. This command retrieves information about currently running processes that are named RuntimeBroker.exe.
The command begins with the wmic
keyword -- the utility's name -- followed by the command body. The body starts with the alias process
. Aliases play an integral role in the WMIC utility. They provide friendly names that abstract the more complex underlying logic needed to retrieve WMI information and carry out administrative tasks. In this case, the process
alias is used to retrieve a list of specific processes, as qualified by the where
option and its name
value.
The process
alias and its where
option are then followed by the verb list
, which is one of multiple verbs WMIC supports. A verb carries out some type of action. In this context, the list
verb returns information about the specified processes. The verb is also accompanied by the brief
option, which tells WMI to return only a subset of the available information about each process.
When a user runs a WMIC command in noninteractive mode, they're returned to the command prompt after the command has completed. However, if users want to work interactively with WMI, they should instead use interactive mode by typing wmic at the command prompt and pressing Enter. The command prompt changes to wmic:root\cli, as shown in Figure 2.
Once in interactive mode, the user can run WMIC commands without specifying the wmic
keyword at the beginning of each command. The user remains in interactive mode until they specifically exit from it by entering quit
or exit
.
Another option for running WMIC is to invoke the utility directly in the Run
dialog box. After the user opens the dialog box, they can type wmic
in the text box and click OK
. This launches a Terminal window with the WMIC command prompt active, where they can enter commands, as shown in Figure 3.
Users can get help on individual WMIC elements by using the /?
option. For example, they can review a complete list of aliases and global switches by entering /?
at the WMIC command prompt, or get information about a specific alias by entering the alias name, followed by /?
, as in process /?
.
Because the WMIC utility has been deprecated, administrators will likely want to invest their time in PowerShell for WMI, rather than WMIC. However, there might be times when they need to understand WMIC if working with legacy systems or WMIC scripts, in which case, having some knowledge of the utility could be useful.
Examine this helpful tip to learn the most common PowerShell commands for Windows system administrators.