Windows 7 Portable Command Guide: Understanding the Windows Management Instrumentation Command Line
This chapter provides information and commands concerning the following topics:
- Understanding wmic
- Configuring the firewall to allow wmic
- Running wmic
- Modifying the format with the /format switch
- Retrieving help from wmic
- Understanding aliases
- Using verbs
Understanding wmic
wmic is the command-line implementation of Windows Management Instrumentation (WMI). It extends WMI so that you can execute many WMI commands without a full understanding of the underlying details.
WMI is a group of technologies that allows different applications to interact with the Windows operating system. It is based on the Web-Based Enterprise Management (WBEM) standard and it's a full-blown scripting tool. Administrators use WMI scripting to perform a wide variety of administrative tasks, and WMI scripting is included in many third-party vendor tools.
Some of the most valuable commands and switches are summarized in the following table.
Command |
Description |
wmic alias list brief C:\>wmic alias list brief |
Retrieves a list of all aliases. |
wmic aliasname list full C:\>wmic computersystem list full |
Retrieves a list of all properties and known values for any alias. |
wmic aliasname get /? C:\>wmic computersystem get /? |
Retrieves a list of properties for an alias, including the data type and available operations. |
wmic aliasname set /? C:\>wmic computersystem set /? |
Retrieves a list of properties for an alias that can be modified. The list includes the data type and available operations. |
/output: target C:\>wmic /output:c:\data\cpu.txt computersystem list full |
Redirects the output to a file. You can redirect the output to the Clipboard by using /output:clipboard. |
delete ( a process ) wmic process where (name = process-name )delete C:\>wmic process where (name ='notepad.exe') delete |
Deletes an instance of a running process. |