How to use wmic command-line utility in Windows
Aug 01, 2025 am 04:41 AMThe wmic command queries system information through aliases, operations and conditions and executes management tasks. 1. Enter wmic to enter the interactive environment or run the command directly; 2. Common aliases include computersystem, os, cpu, process, service, etc., which are used to obtain system, hardware, process and service information; 3. Use the where clause to filter the results, such as filtering by memory usage or service status; 4. Supports output formats such as list, csv, xml, etc., and is recommended to use in non-interactive mode; 5. Note that it is case-insensitive, does not support wildcards, but can be matched like, has slow performance, and has been replaced by PowerShell; 6. Enter exit at the wmic prompt to exit. Despite being deprecated, wmic is suitable for fast diagnostic and scripting tasks in PowerShell-free environments.
The wmic
(Windows Management Instrumentation Command-line) utility is a powerful tool in Windows that allows you to query system information, management processes, services, hardware, and more—all from the command line. Although Microsoft has started deprecating wmic
in favor of PowerShell, it's still available and widely used in many environments, especially for scripting and troubleshooting.

Here's how to use the wmic
command effectively:
1. Accessing WMIC
Open Command Prompt with administrative or standard user privileges:

- Press
Win R
, typecmd
, and press Enter. - Type
wmic
and press Enter to enter the WMIC shell.
C:\> wmic
You'll see the prompt change to wmic:root\cli>
, indicating you're inside the WMIC environment.
Alternatively, you can run wmic
commands directly without entering the shell:

wmic [alias] [command] [parameters]
2. Common WMIC Aliases and Usage Examples
WMIC organizes system data into aliases , which represents different types of system components. Here are some of the most useful ones:
System Information (Computer System)
Get basic system details like model, manufacturer, and number of CPUs.
wmic computersystem get name, manufacturer, model, numberofprocessors, totalphysicalmemory
Operating System Info
Check OS version, install date, and architecture.
wmic os get caption, version, csdversion, installdate, osarchitecture
Processor Details
Get CPU name, number of cores, and clock speed.
wmic cpu get name, numberofcores, maxclockspeed
Installed Hotfixes (Updates)
List all applied Windows updates.
wmic qfe get caption, description, hotfixid, installedon
Useful for troubleshooting or verifying patch levels.
Running Processes
List all running processes or kill a process by name/PID.
List processes:
wmic process get name, processid, caption
Kill a process by name (eg, notepad.exe):
wmic process where name="notepad.exe" delete
Kill by PID:
wmic process where processid=1234 delete
Startup Programs
List programs that run at startup.
wmic startup get caption, command, location
Service Management
Check service status or start/stop services.
List all services:
wmic service get name, displayname, state, startmode
Start a service:
wmic service where name="Spooler" call startservice
Stop a service:
wmic service where name="Spooler" call stopservice
Disk and Partition Info
Get details about logical disks and partitions.
Disk drives:
wmic logicaldisk get deviceid, volumename, freespace, size
Partition info:
wmic partition get deviceid, type, bootable, size
BIOS Information
Check BIOS version and manufacturer.
wmic bios get serialnumber, manufacturer, smbiosbiosversion
Often used for asset tracking.
User Accounts
List local user accounts.
wmic useraccount get name, disabled, localaccount, sid
Filter only local accounts:
wmic useraccount where localaccount=true get name
3. Using Filters (WHERE Clause)
You can filter results using the where
keyword, similar to SQL.
Examples:
Find processes using more than 100 MB of memory:
wmic process where "workingsetsize > 10000000" get name, workingsetsize
Find services that are currently running:
wmic service where state="running" get name, displayname
Find a specific service:
wmic service where name="winrm" get state, startmode
4. Output Formats
By default, WMIC outputs in table format. You can change the output format:
List format:
wmic /format:list os get caption, version
CSV format:
wmic /format:csv logicaldisk get deviceid, freespace > diskinfo.csv
XML format:
wmic /format:xml process get name > processes.xml
Note: Some formats may not work well in the WMIC shell—better used in direct command mode.
5. Tips and Limitations
- Case Insensitive : WMIC commands are generally case-insensitive.
- No Wildcards in WHERE : You can't use
*
inwhere
clauses. Uselike
for pattern matching:wmic process where "name like 'chrome%'" get name, processid
- Performance : Some queries (eg,
wmic process list full
) can be slow. - Deprecated : Microsoft recommends using PowerShell (eg,
Get-WmiObject
,Get-CimInstance
) instead.
6. Exit WMIC Shell
If you entered the WMIC environment, type:
exit
to return to the regular command prompt.
While wmic
is being phased out, it remains a quick and effective tool for gathering system data and performing management tasks—especially in legacy scripts or environments where PowerShell isn't available.
Basically, just remember: wmic [alias] [verb] [where clause] [get/format]
. Once you know a few key aliases, it becomes a fast way to pull system info without installing extra tools.
The above is the detailed content of How to use wmic command-line utility in Windows. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

WMIC is an important tool for system administrators. It provides an efficient and precise way to manage Windows systems under the "Command Prompt". Administrators can use WMIC to perform system configuration, query and monitoring operations. Microsoft has announced that WMIC will be phased out in future versions of Windows: Windows 1021H1: WMIC's user interface (UI) has been deprecated. Windows 1123H2 and 22H2: WMIC is provided as an "optional feature" but is still installed by default. Windows 1124H2: WMIC will be completely removed. In addition, starting from January 29, 2024, WMIC will only be available as an optional feature in the Windows preview version.

Many friends who use win10 system have encountered this problem when playing games or installing the system. The application cannot be started because the parallel configuration of the application is incorrect. For more information, see the application event log, or use the command line sxstrace.exe tool. This may be because the operating system does not have corresponding permissions. Let’s take a look at the specific tutorial below. Tutorial on using the command line sxstrace.exe tool 1. This problem usually occurs when installing programs and games. The prompt is: The application cannot be started because the parallel configuration of the application is incorrect. For more information, see the application event log, or use the command line sxstrace.exe tool. 2. Start →

For those unfamiliar, Low Power Mode reduces your Mac's energy usage, potentially extending battery life at the expense of performance temporarily, but it's handled well enough that for most users, they won't notice to any particular degradation. This is a very useful mode if you're a Mac laptop user trying to get the most battery life possible from your MacBook Pro or Air. Enable Mac Low Power Mode from the Command Line From the Terminal, type the following command string on any Mac laptop: sudo pmset -a lowpowermode 1 Press Enter as sudo requires and enter the administrator password to authenticate.

This article details the steps to upgrade Ubuntu 20.04 to 22.04. For users using Ubuntu 20.04, they have missed the new features and advantages brought by version 22.04. In order to get a better experience and security, it is recommended to upgrade to a newer Ubuntu version in time. Ubuntu22.04 is codenamed "Jamie Jellyfish", let's explore how to get the latest LTS version! How to upgrade Ubuntu 20.04 to 22.04 via the command line Mastering the command line will give you an advantage. While it is possible to update Ubuntu via the GUI, our focus will be via the command line. First, let’s check the currently running version of Ubuntu using the following command: $

Start the journey of Django project: start from the command line and create your first Django project. Django is a powerful and flexible web application framework. It is based on Python and provides many tools and functions needed to develop web applications. This article will lead you to create your first Django project starting from the command line. Before starting, make sure you have Python and Django installed. Step 1: Create the project directory First, open the command line window and create a new directory

In Python, parameters can be passed to scripts via the command line. These parameters can be used inside scripts to perform different actions based on different inputs. Detailed explanation of Python command line parameters: 1. Positional parameters: parameters passed to the script in order on the command line. They can be accessed through position inside the script; 2. Command line options: parameters starting with - or -, usually Used to specify specific options or flags for the script; 3. Pass parameter values: Pass parameter values ??through the command line.

How to perform log aggregation and statistics through Linux command line tools? Logging is a very important task when managing and maintaining Linux systems. Through logs, you can view system operation, troubleshoot problems, and conduct performance analysis. For large-scale systems, the number of logs is often very large. How to efficiently aggregate and count logs has become a challenge faced by operation and maintenance personnel. In Linux systems, we can use command line tools for log aggregation and statistics. The following will introduce several commonly used command lines

Solution to the problem that javac is not an internal or external command and is not an operable program: 1. First download the latest version of JDK from the official website and install it; 2. Configure the system environment variables and add the jdk installation path to the path; 3. Enter the computer command Run the interface, enter "java -v" and the version number will appear.
