The WMI command-line (WMIC) utility provides a command-line interface for Windows Management Instrumentation (WMI). WMIC is compatible with existing shells and utility commands.
Pasi de urmat
Creates a new instance and sets the property values. CREATE cannot be used to create a new class.
Example: ENVIRONMENT CREATE NAME=”TEMP”; VARIABLEVALUE=”NEW”
Deletes the current instance or set of instances. DELETE can be used to delete a class.
Example: PROCESS WHERE NAME=”CALC.EXE” DELETE
Retrieve specific property values.
GET has the following switches.
|/VALUE||Output is formatted with each value listed on a separate line and with the name of the property.|
|/ALL||Output is formatted as a table.|
|/TRANSLATE:||Translate the output using the translation table named by the command. The translation tables BasicXml and NoComma are included with WMIC.|
|/EVERY:||Repeat the command every seconds.|
|/FORMAT:||Specifies a key word or XSL file name to format the data.|
Example: PROCESS GET NAME
Shows data. LIST is the default verb.
LIST has the following adverbs.
Adverb Description BRIEF Core set of the properties. FULL Full set of properties. This is the default adverb for LIST. INSTANCE Instance paths only. STATUS Status of the objects. SYSTEM System properties.
LIST has the following switches.
TABLE 4 Switch Description /TRANSLATE: Translate the output using the translation table named by the command. The translation tables BasicXml and NoComma are included with WMIC. /EVERY: Repeat the command every seconds. /FORMAT: Specifies a key word or XSL file name to format the data.
Example: PROCESS LIST BRIEF
- Assigns values to properties. Example: ENVIRONMENT SET NAME=”TEMP”, VARIABLEVALUE=”NEW”
Global switches are used to set defaults for the WMIC environment. You can view the current value of the conditions set by these switches by entering the CONTEXT command.
- Namespace the alias uses typically. The default is root\cimv2.
- Namespace WMIC typically looks in for aliases and other WMIC information.
- Computer names, comma delimited. All commands are synchronously executed against all computers listed in this value. File names must be prefixed with &. Computer names within a file must be comma delimited or on separate lines.
- Impersonation level.
- Authentication level.
- Enable or disable all privileges.
Example: /PRIVILEGES:ENABLE or /PRIVILEGES:DISABLE
- Display the success or failure of all functions used to execute WMIC commands.
Example: /TRACE:ON or /TRACE:OFF
- Records all output to an XML file. Output is also displayed at the command prompt.
- Typically, delete commands are confirmed.
Example: /INTERACTIVE:ON or /INTERACTIVE:OFF
- /FAILFAST on|off|TimeoutInMilliseconds
- If ON the /NODE computers are pinged before sending WMIC commands to them. If a computer does not respond the WMIC commands are not sent to it.
Example: “/FAILFAST:ON” or “/FAILFAST:OFF”
- User name used by WMIC when accessing the /NODE computers or computers specified in the aliases. You are prompted for the password. A user name cannot be used with the local computer.
- Password used by WMIC when accessing the /NPDE computers. The password is visible at the command line.
- Specifies a mode for all output redirection. Output does not appear at the command line and the destination is cleared before output begins. Valid values are STDOUT, CLIPBOARD or a file name.
- Specifies a mode for all output redirection. Output does not appear at the command line and the destination is not cleared before output begins and output is appended to the end of the current contents of the destination. Valid values are STDOUT, CLIPBOARD or a file name.
- Used with the LIST and GET /EVERY switch. If AGGREGATE is ON, LIST and GET display their results when all computers in the /NODE have either responded or timed out. If AGGREGATE is OFF, LIST and GET display their results as soon as they are received.
Example: /AGGREGATE:OFF or /AGGREGATE:ON