The Windows Management Instrumentation Command-line (WMIC) tool



The Windows Management Instrumentation Command-line (WMIC) is a command-line and scripting interface that simplifies the use of Windows Management Instrumentation (WMI) and systems managed through WMI.

WMIC is based on aliases. Aliases make the primary data provided by WMI available without having to understand WMI-specific concepts. WMI data and many WMI features are also accessible through WMI without aliases.

You can list the available aliases by using WMIC /? help. WMIC has a progressive help system. You can use /? at any time and at any depth to discover the additional options that are available in the current context. /? lists the currently available aliases, commands, and the global switches (that is, switches that apply to WMIC overall). To list the verbs and switches available for an alias, type the name of the alias and /?. To list the parameters available for a particular verb, type the name of the alias, the verb, and then /?.

For example, the processes running on the current system are available from the PROCESS alias. To view all of the processes that are currently running on the computer, type PROCESS in the WMIC utility. To list a specific process, type a command such as PROCESS WHERE (Description="explorer.exe"). To receive specific properties for the processes, type a command such as PROCESS GET Name, Handle, PageFaults.

Without using aliases, you can use the same options with the CLASS command. For example, CLASS Win32_Process GET Name, Handle, PageFaults. However, you must determine the name of the class from other sources. To do the equivalent of the alias Where clause, you must use PATH Win32_Process.Description="explorer.exe".

For more information about using and extending WMIC, see WMI Command-line in Windows XP Help. This documentation includes information about using WMIC in batch files, for reporting, with remote and multiple computers, and for system management.
Command
Result
/?
Displays help.
CLASS
Escapes from the default alias mode of WMIC to access classes in the WMI schema directly.
PATH
Escapes from the default alias mode of WMIC to access instances in the WMI schema directly.
CONTEXT
Displays the current values of all global switches.
QUIT
Exits WMIC.
EXIT
Exits WMIC.


System File Checker (sfc)

Scans and verifies the versions of all protected system files after you restart your computer.

Syntax

sfc [/scannow] [/scanonce] [/scanboot] [/revert] [/purgecache] [/cachesize=x]

Parameters

/scannow : Scans all protected system files immediately.
/scanonce : Scans all protected system files once.
/scanboot : Scans all protected system files every time the computer is restarted.
/revert : Returns the scan to its default operation.
/purgecache : Purges the Windows File Protection file cache and scans all protected system files immediately.
/cachesize=x : Sets the size, in MB, of the Windows File Protection file cache.
/? : Displays help at the command prompt.

Remarks

You must be logged on as a member of the Administrators group to run sfc.
If sfc discovers that a protected file has been overwritten, it retrieves the correct version of the file from the %systemroot%\system32\dllcache folder, and then replaces the incorrect file.
If the %systemroot%\system32\dllcache folder becomes corrupt or unusable, use sfc /scannow, sfc /scanonce, or sfc /scanboot to repair the contents of the Dllcache directory.

Formatting legend

Format
Meaning
Italic
Information that the user must supply
Bold
Elements that the user must type exactly as shown
Ellipsis (...)
Parameter that can be repeated several times in a command line
Between brackets ([])
Optional items
Between braces ({}); choices separated by pipe (|). Example: {even|odd}
Set of choices from which the user must choose only one
Courier font
Code or program output



Written by