Windows WMIC (Windows Management Interface Command) Tutorial with Examples

 WMIC or Windows Management Interface Command is a simple command line tool used to issue WMI commands. WMI command generally used to query all of the system related information like Computer Name, BIOS Serial Number, Mac Address etc.

Batch WMIC

WMIC provides two type of usage. Batch usage is the most popular where we can issue WMI commands into MS-DOS or PowerShell like below.

> wmic /?
Batch WMIC
Batch WMIC

Interactive WMIC Command Line

WMIC also provides an interactive shell where we can issue wmic options as commands. We can enter VMIC interactive shell just running wmic command like below.

PS> wmic
Interactive WMIC Command Line
Interactive WMIC Command Line

Find Computer Manufacturer and Model

We can use Computer option in order to print the current system manufacturer and model.

> wmic ComputerSystem GET Model
Find Computer Manufacturer and Model
Find Computer Manufacturer and Model

Print Computer Name

Computer name can be printed with the computersystem and name options like below.

> wmic computersystem get name
Print Computer Name
Print Computer Name

Print BIOS Serial Number

Every computer system have a serial number. This serial number is unique to the system. We can print current system serial number with the bios and serialnumber options like below.

> wmic bios get serialnumber
Print Serial Number
Print Serial Number

Print Network Interface Mac Addresses

wmic command also provides operations about the Network Interface. We can use nic option with different extra options like macaddress ,description.

> wmic nic get macaddress
Print Network Interface Mac Addresses
Print Network Interface Mac Addresses

Print Motherboards Model and Number

Mothterboards have some model and model number information. We can print motherboard model with the following command.

> wmic baseboard get product
Print Motherboards Model and Number
Print Motherboards Model and Number

Print RAM or Physical Memory Size

We can use wmic command in order to get RAM or Physical Memory Size information with the following command.

> wmic COMPUTERSYSTEM get TotalPhysicalMemory
Print RAM or Physical Memory Size
Print RAM or Physical Memory Size

Print All Running Application, Programmes, and Their RAM/Memory Usage

We can print currently running applications, programmes and their RAM or Memory usage with the process option like below.

> wmic process get workingsetsize,commandline
Print All Running Application, Programmes, and Their RAM/Memory Usage
Print All Running Application, Programmes, and Their RAM/Memory Usage

Print Partition Name, Size, and Type

We can use partition option with the name,size and type options to print partitions information and file system type.

> wmic partition get name,size,type
Print Partition Name, Size, and Type
Print Partition Name, Size, and Type

List Services

We can list currently installed Services on the system. We will use  service option with the list and brief options like below.

> wmic service list brief

List Processes

Currently running process and brief information about the can be listed lie below.

> wmic process list brief
List Processes
List Processes

Kill Given Process

Even we can use wmic to kill the current running process. We will use process option with the where statement and related terminate command. In this example, we will kill the process named chrome.exe which can be listed with the previous command.

>wmic process where name="chrome.exe" call terminate
Kill Given Process
Kill Given Process

List Startup Applications

After the Windows operating system is started some applications are started automatically. These applications are different from services. They are generally called Startup Applications. We can list these Startup Applications with the wmic like below.

> wmic startup list brief
List Startup Applications
List Startup Applications

Write WMIC Output Into A File

We can redirect any wmic command output into a file. We will use the redirect operator > . In this example, we will write the  process list into a file named processes.txt . Keep in mind that we should have write access to the current working directory.

>wmic process list brief > process.txt

List Disk Drives (HDD)

We can use diskdrive option in order to list currently connected disk drives. These drives can be HDD or ISCSI or similar.

> wmic diskdrive get model,name,size
List Disk Drives (HDD)
List Disk Drives (HDD)

List Brief Operating System Information

We can also print basic operating system information. This will provide following inforation

  • Build Number
  • Organization
  • Registered USer
  • Serial Number
  • System Directory
  • Version
>wmic os list brief
List Brief Operating System Information
List Brief Operating System Information

Comments