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.
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 /?
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.
Find Computer Manufacturer and Model
We can use
Computer option in order to print the current system manufacturer and model.
> wmic ComputerSystem GET Model
Print Computer Name
Computer name can be printed with the
name options like below.
> wmic computersystem get 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
serialnumber options like below.
> wmic bios get serialnumber
Print Network Interface Mac Addresses
wmic command also provides operations about the Network Interface. We can use
nic option with different extra options like
> wmic nic get macaddress
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 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 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 Partition Name, Size, and Type
We can use
partition option with the
type options to print partitions information and file system type.
> wmic partition get name,size,type
We can list currently installed Services on the system. We will use
service option with the
brief options like below.
> wmic service list brief
Currently running process and brief information about the can be listed lie below.
> wmic process list brief
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
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
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 Brief Operating System Information
We can also print basic operating system information. This will provide following inforation
- Build Number
- Registered USer
- Serial Number
- System Directory
>wmic os list brief