- Command Prompt (Windows)
Infobox Windows component
name = Command Prompt
logo_size = 64px
caption = Command Prompt inWindows Vista |
included_with =Windows NT -Windows CE -OS/2
replaces =COMMAND.COM
replaced_by =
related_components =Windows PowerShell -Batch file cmd.exe
is thecommand line interpreter onOS/2 ,Windows CE and onWindows NT -based operating systems (including Windows 2000, XP, Vista, Server 2003 and Server 2008). It is the analog of
inCOMMAND.COM MS-DOS andWindows 9x systems, or of theUnix shell s used onUnix-like systems.Versions
Therese Stowell developed the initial version ofcmd.exe
for Windows NT. [cite book |title=Showstopper! The Breakneck Race to Create Windows NT and the Next Generation at Microsoft |first=G. Pascal |last=Zachary |authorlink=G. Pascal Zachary |year=1994 |publisher=Warner Books |id=ISBN 0-02-935671-7] Although some old DOS commands are not supported or have been changed (e.g. the functionality of
was rolled intodeltree rd
in the form of the /s parameter),cmd.exe
still has a greater number of built-in commands.Both the OS/2 and the Windows NT versions of
cmd.exe
have more detailed error messages than the blanket "Bad command or file name" (in the case of malformed commands) of command.com. In the OS/2 version ofcmd.exe
, errors are reported in the current language of the system, their text being taken from the system message files. The help command can then be issued with the error message number to obtain further information.cmd.exe
, which remains part ofWindows Vista andWindows Server 2008 for backward compatibility, will be supplemented withWindows PowerShell , Microsoft's new extensible command line shell and task-based scripting technology.Technical information
Unlike
, which is aCOMMAND.COM DOS program,cmd.exe
is a native program for the platform. This allows it to take advantage of features available to native programs on the platform and not available to DOS programs. For example, sincecmd.exe
is a native text-mode application onOS/2 , 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 incmd.exe
, unlikeCOMMAND.COM
. (COMMAND.COM
uses temporary files, and runs the two sides serially, one after the other.)Technically,
cmd.exe
is a Windows program that acts as a DOS-like command line interpreter. It is generally compatible, but provides extensions which address the limitations ofCOMMAND.COM
:*
SETLOCAL
/ENDLOCAL
commands limit the scope of changes to the environment
* internalCALL
andGOTO
labels lessen the need for individual batch files to perform parts of a task.
* filename-parsing extensions to theSET
command are comparable toC shell .
* an expression-evaluation extensions is also provided in theSET
command.
* an expansion of theFOR
command to support parsing files and arbitrary sets in addition to filenames.
* use of arrow keys to scroll through command history (provided by
inDOSKey COMMAND.COM
)
* off-by-default path completion capabilities similar tobash
tab completion
* a directory stack accessible with thePUSHD
andPOPD
commands
*IF
can perform case-insensitive comparisons and numeric equality and inequality comparisons in addition to case-sensitive string comparisonsThe extensions can be disabled, providing a stricter compatibility mode.
See also
*
Batch file Description of writing scripts in the shell
*Comparison of computer shells
*List of DOS commands References
External links
* [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true MSDN Documentation for cmd.exe on Windows XP]
* [http://www.dostips.com/DtTutoFunctions.php DOS Batch - CALL Functions and Recursion]
Wikimedia Foundation. 2010.