Friday, January 9, 2015

WMIC (Windows Managment Instrumentation Command-Line) commands

WMIC commands are used for system management in Windows. Here are few wmic commands.

Invoking WMIC: 
1) Start -> Run -> wmic  or
2) Start -> Run -> Cmd -> wmic

Commands
1) "useraccount list brief " : Displays list of users, account types, domain, etc
AccountType  Caption                   Domain     FullName        Name          
512          Lenovo-PC\Administrator   Lenovo-PC                  Administrator

2) process where name='outlook.exe'
    Caption      CommandLine  CreationDate CSName   Description
OUTLOOK.EXE  "C:\Program Files\Microsoft Office 15\root\office15\OUTLOOK.EXE"  20150109101912.955375+330  LENOVO-PC  OUTLOOK.EXE

3) process where name="Skype.exe" get ProcessID,ParentProcessID
ParentProcessId  ProcessId
4864             7196
4) process where name='outlook.exe' call terminate

5) process list brief
HandleCount  Name                           Priority  ProcessId  ThreadCount  WorkingSetSize
0            System Idle Process            0         0          4            4096
2385         System                         8         4          138          10182656
280          chrome.exe                     8         5056       5            107802624
1064         Skype.exe                      8         7196       39           185180160

6) wmic /node:"Lenovo-PC" printer list status  : To list the printers connected to this machine
Name                           Status
Send To OneNote 2013           Unknown
Nitro PDF Creator (Pro 9)      Unknown
Microsoft XPS Document Writer  Unknown
Fax                            Unknown

7) wmic /node:"Lenovo-PC" cpu get name, caption, maxclockspeed, systemname /format:textvaluelist.xsl

Caption=Intel64 Family 6 Model 60 Stepping 3
MaxClockSpeed=2594
Name=Intel(R) Core(TM) i5-4300M CPU @ 2.60GHz
SystemName=LENOVO-PC

8) wmic bios get Manufacturer,ReleaseDate,SerialNumber,Version
9) wmic baseboard get Manufacturer,Name,Product,SerialNumber,Version :  To get motherboard info
10) wmic bootconfig get BootDirectory,Caption,LastDrive,TempDirectory
11) C:\Users\SBGurusiddappa>wmic cpu get Manufacturer,AddressWidth,CurrentClockSpeed
,CurrentVoltage,DataWidth,Family,LoadPercentage,MaxClockSpeed,NumberOfCores,Numb
erOfLogicalProcessors,ProcessorId,ProcessorType -format:textvaluelist.xsl
12) wmic desktop get Wallpaper
13) startup list brief
14) timezone list brief