Running Windows Management Instrumentation Command-line

Running Windows Management Instrumentation Command-line

When you run Windows Management Instrumentation Command-line (WMIC) for the first time, it compiles Alias definitions, or Managed Object Format (MOF) files. Whenever MOF files are changed, WMIC recompiles the files and updates the repository.

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

WMIC in interactive mode returns you to the WMIC command prompt after executing a command. Root\cli is the default WMIC role, and is there when you starts WMIC in interactive mode. The Exit or Quit command is used to exit WMIC.

Interactive mode is useful if you are entering a series of WMIC commands.

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

WMIC in non-interactive mode exits WMIC after performing the command you entered. You are returned to the WMIC command prompt when the command is completed. WMIC aliases, global switches, or commands can also be used in 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.