cmd.exe is the default command-line interpreterforOS/2, eComStation, Microsoft Windows, and the ReactOSoperating systems. The name refers to its executable filename. It is also commonly referred to as cmd or the Command Prompt, referring to the default window title on Windows. The implementations differ on the various systems but the behavior and basic set of commands is generally consistent. is the counterpart of in DOS and Windows 9x systems, and analogous to the Unix shells used on Unix-like systems. The initial version of for Windows NT was developed by Therese Stowell. Windows CE 2.11 was the first embedded Windows release to support a console and a Windows CE version of. On Windows CE.NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0 it is also referred to as Command Processor Shell. The ReactOS implementation of is derived from FreeCOM, the FreeDOScommand line interpreter.
Operation
interacts with the user through a command-line interface. On Windows, this interface is implemented through the Win32 console. may take advantage of features available to native programs of its own platform. For example, on OS/2 and Windows, it can use real pipes in command pipelines, allowing both sides of the pipeline to run concurrently. As a result, it is possible to redirect the standard error stream. Multiple commands can be processed in a single command line using the command separator. For example: C:\>CommandA && CommandB && CommandC
On Windows XP or later, the maximum length of the string that can be used at the command prompt is 8191 characters. On earlier versions, such as Windows 2000 or Windows NT 4.0, the maximum length of the string is 2047 characters. This limit includes the command line, individual environment variables that are inherited by other processes, and all environment variable expansions. Quotation marks are required for the following special characters: & < > ^ = ; ! ' +, ` ~
On Windows, is mostly compatible with but provides the following extensions over it:
More detailed error messages than the blanket "Bad command or file name" of. In OS/2, errors are reported in the chosen language of the system, their text being taken from the system message files. The command can then be issued with the error message number to obtain further information.
Supports using of arrow keys to scroll through command history.
Treats the caret character as the escape character; the character following it is to be taken literally. There are special characters in and that are meant to alter the behavior of the command line processor. The caret character forces the command line processor to interpret them literally.
Supports delayed variable expansion with, allowing values of variables to be calculated at runtime instead of during parsing of script before execution, fixing DOS idioms that made using control structures hard and complex. The extensions can be disabled, providing a stricter compatibility mode.
Internal commands have also been improved:
The command was merged into the command, as part of its switch.
An expansion of the command supports parsing files and arbitrary sets in addition to file names.
The new and commands provide access past navigated paths similar to "forward" and "back" buttons in a web browser or File Explorer.
The conditional command can perform case-insensitive comparisons and numeric equality and inequality comparisons in addition to case-sensitive string comparisons.