Running Windows Management Instrumentation Command-line
Updated: January 21, 2005
You can choose to use WMIC in interactive mode or non-interactive mode. The following gives you some information about the characteristics and functions of the two modes:
Interactive mode
Interactive mode is useful if you are entering a series of WMIC commands.
To start WMIC in interactive mode see Run WMIC in interactive mode .
The following examples include aliases, commands, and global switches that you can enter at the WMIC prompt when in interactive WMIC mode:
- CONTEXT - lists all environment variables (Global switches).
- OS - displays data about operating system in a default TABLE format.
- OS list full - displays OS alias data in LIST format.
- /? - lists descriptions of available
environment variables and alias.
- OS /? - lists options available for operating systems.
- OS list /? - specifies formats for "list" operations.
- OS list full /? - lists switches available.
- OS list full /format /? - lists keywords for available formats.
- OS call /? - lists methods (verbs) available.
- OS get /? - lists properties available.
Non-Interactive mode
Non-interactive mode is useful if you use WMIC for a batch procedure, or if you only need to execute one WMIC command.
To start WMIC in non-interactive mode see Run WMIC in non-interactive mode .
The following examples show how you can run commands in non-interactive mode:
- <PROMPT>wmic os get /format:hform>MyOS.htm
The output is directed to a html file, and you are returned to the command prompt where you started.
- <PROMPT>wmic /?
The Help is listed, and you are returned to the command prompt where you started
For more information, see Windows Management Instrumentation Command-line .