Command Prompt (Windows)
   HOME

TheInfoList



OR:

Command Prompt, also known as cmd.exe or cmd, is the default
command-line interpreter A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
for the
OS/2 OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 r ...
,
eComStation eComStation or eCS is an operating system based on OS/2 Warp for the 32-bit x86 architecture. It was originally developed by Serenity Systems and Mensys BV under license from IBM. It includes additional applications, and support for new hard ...
, ArcaOS, Microsoft Windows (
Windows NT family Windows NT is a proprietary graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user operating system. The first version of Wind ...
and Windows CE family), and ReactOS operating systems. On
Windows CE .NET 4.2 Windows Embedded Compact, formerly Windows Embedded CE, Windows Powered and Windows CE, is an operating system subfamily developed by Microsoft as part of its Windows Embedded family of products. Unlike Windows Embedded Standard, which is base ...
, Windows CE 5.0 and Windows Embedded CE 6.0 it is referred to as the Command Processor Shell. Its implementations differ between operating systems, but the behavior and basic set of commands are consistent. is the counterpart of in
DOS DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems. DOS may also refer to: Computing * Data over signalling (DoS), multiplexing data onto a signalling channel * Denial-of-service attack (DoS), an attack on a communicat ...
and
Windows 9x Windows 9x is a generic term referring to a series of Microsoft Windows computer operating systems produced from 1995 to 2000, which were based on the Windows 95 kernel and its underlying foundation of MS-DOS, both of which were updated in su ...
systems, and analogous to the
Unix shell A Unix shell is a command-line interpreter or shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and is used by the operating syste ...
s used on
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems. The initial version of for
Windows NT Windows NT is a proprietary graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user operating system. The first version of Win ...
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 . The ReactOS implementation of is derived from FreeCOM, the
FreeDOS FreeDOS (formerly Free-DOS and PD-DOS) is a free software operating system for IBM PC compatible computers. It intends to provide a complete MS-DOS-compatible environment for running legacy software and supporting embedded systems. FreeDOS can ...
command line interpreter.


Operation

interacts with the user through a command-line interface. On Windows, this interface is implemented through the
Win32 console Windows Console is the infrastructure for console applications in Microsoft Windows. An instance of a Windows Console has a screen buffer and an input buffer. It allows console apps to run inside a window or in hardware text mode (so as to oc ...
. 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 Pipe(s), PIPE(S) or piping may refer to: Objects * Pipe (fluid conveyance), a hollow cylinder following certain dimension rules ** Piping, the use of pipes in industry * Smoking pipe ** Tobacco pipe * Half-pipe and quarter pipe, semi-circula ...
in command pipelines, allowing both sides of the pipeline to run concurrently. As a result, it is possible to redirect the standard error stream. ( uses temporary files, and runs the two sides serially, one after the other.) Multiple commands can be processed in a single command line using the command separator . When using this separator in the Windows , each command must complete successfully for the following commands to execute. For example: C:\>CommandA && CommandB && CommandC In the above example, will only execute if completes successfully, and the execution of depends on the successful completion of . To process subsequent commands even if the previous command produces an error, the command separator should be used. For example: C:\>CommandA & CommandB & CommandC On
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct upgrade to its predecessors, Windows 2000 for high-end and ...
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 Windows 2000 is a major release of the Windows NT operating system developed by Microsoft and oriented towards businesses. It was the direct successor to Windows NT 4.0, and was released to manufacturing on December 15, 1999, and was officiall ...
or
Windows NT 4.0 Windows NT 4.0 is a major release of the Windows NT operating system developed by Microsoft and oriented towards businesses. It is the direct successor to Windows NT 3.51, which was released to manufacturing on July 31, 1996, and then to retail ...
, the maximum length of the string is 2047 characters. This limit includes the command line, individual
environment variable An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP envi ...
s that are inherited by other processes, and all environment variable expansions. Quotation marks are required for the following
special character As of Unicode version 15.0, there are 149,186 characters with code points, covering 161 modern and historical scripts, as well as multiple symbol sets. This article includes the 1062 characters in the Multilingual European Character Set 2 (MES ...
s: & < > ^ = ; ! ' + , ` ~ hite space


Internal commands


OS/2

The following is a list of the Microsoft OS/2
internal Internal may refer to: *Internality as a concept in behavioural economics *Neijia, internal styles of Chinese martial arts *Neigong or "internal skills", a type of exercise in meditation associated with Daoism *''Internal (album)'' by Safia, 2016 ...
commands: *
break Break or Breaks or The Break may refer to: Time off from duties * Recess (break), time in which a group of people is temporarily dismissed from its duties * Break (work), time off during a shift/recess ** Coffee break, a short mid-morning res ...
* chcp * cd * chdir * cls *
copy Copy may refer to: *Copying or the product of copying (including the plural "copies"); the duplication of information or an artifact **Cut, copy and paste, a method of reproducing text or other data in computing **File copying **Photocopying, a pr ...
*
date Date or dates may refer to: *Date (fruit), the fruit of the date palm (''Phoenix dactylifera'') Social activity *Dating, a form of courtship involving social activity, with the aim of assessing a potential partner ** Group dating *Play date, a ...
*
del Del, or nabla, is an operator used in mathematics (particularly in vector calculus) as a vector differential operator, usually represented by the nabla symbol ∇. When applied to a function defined on a one-dimensional domain, it denotes ...
* detach * dir * dpath *
echo In audio signal processing and acoustics, an echo is a reflection of sound that arrives at the listener with a delay after the direct sound. The delay is directly proportional to the distance of the reflecting surface from the source and the lis ...
*
erase Erase may refer to: *Data erasure, a method of software-based overwriting that completely destroys all electronic data *Data remanence, the residual representation of data that has been, in some way, nominally erased or removed * ''Erase'' (album ...
*
exit Exit(s) may refer to: Architecture and engineering * Door * Portal (architecture), an opening in the walls of a structure * Emergency exit * Overwing exit, a type of emergency exit on an airplane * Exit ramp, a feature of a road interchange ...
* for * goto * if * md *
mkdir The mkdir (make directory) command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, ...
*
path A path is a route for physical travel – see Trail. Path or PATH may also refer to: Physical paths of different types * Bicycle path * Bridle path, used by people on horseback * Course (navigation), the intended path of a vehicle * Desire p ...
* pause * prompt * rd * rem * ren * rename *
rmdir In computing, rmdir (or rd) is a command which will remove an empty directory on various operating systems. Implementations The command is available in Unix (e.g. macOS, Solaris, AIX, HP-UX), Unix-like (e.g. FreeBSD, Linux), DOS, Digital Resear ...
* set * shift * start *
time Time is the continued sequence of existence and events that occurs in an apparently irreversible succession from the past, through the present, into the future. It is a component quantity of various measurements used to sequence events, ...
* type *
ver Ver or VER may refer to: * Voluntary Export Restraints, in international trade * VER, the IATA airport code for General Heriberto Jara International Airport * Volk's Electric Railway, Brighton, England * VerPublishing, of the German group VDM P ...
*
verify CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS (typically residing ...
* vol


Windows NT family

The following list of internal commands is supported by on
Windows NT Windows NT is a proprietary graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user operating system. The first version of Win ...
and later: *
assoc In computing, a file association associates a file with an application capable of opening that file. More commonly, a file association associates a class of files (usually determined by their filename extension, such as .txt) with a corresponding a ...
*
break Break or Breaks or The Break may refer to: Time off from duties * Recess (break), time in which a group of people is temporarily dismissed from its duties * Break (work), time off during a shift/recess ** Coffee break, a short mid-morning res ...
*
call Call or Calls may refer to: Arts, entertainment, and media Games * Call, a type of betting in poker * Call, in the game of contract bridge, a bid, pass, double, or redouble in the bidding stage Music and dance * Call (band), from Lahore, Paki ...
* cd * chdir * cls *
color Color (American English) or colour (British English) is the visual perceptual property deriving from the spectrum of light interacting with the photoreceptor cells of the eyes. Color categories and physical specifications of color are assoc ...
*
copy Copy may refer to: *Copying or the product of copying (including the plural "copies"); the duplication of information or an artifact **Cut, copy and paste, a method of reproducing text or other data in computing **File copying **Photocopying, a pr ...
*
date Date or dates may refer to: *Date (fruit), the fruit of the date palm (''Phoenix dactylifera'') Social activity *Dating, a form of courtship involving social activity, with the aim of assessing a potential partner ** Group dating *Play date, a ...
*
del Del, or nabla, is an operator used in mathematics (particularly in vector calculus) as a vector differential operator, usually represented by the nabla symbol ∇. When applied to a function defined on a one-dimensional domain, it denotes ...
* dir * dpath *
echo In audio signal processing and acoustics, an echo is a reflection of sound that arrives at the listener with a delay after the direct sound. The delay is directly proportional to the distance of the reflecting surface from the source and the lis ...
* endlocal *
erase Erase may refer to: *Data erasure, a method of software-based overwriting that completely destroys all electronic data *Data remanence, the residual representation of data that has been, in some way, nominally erased or removed * ''Erase'' (album ...
*
exit Exit(s) may refer to: Architecture and engineering * Door * Portal (architecture), an opening in the walls of a structure * Emergency exit * Overwing exit, a type of emergency exit on an airplane * Exit ramp, a feature of a road interchange ...
* for *
ftype __NOTOC__ In computing, ftype is a command-line utility on Microsoft Windows that is used to display or change the link between a file type and an executable program. Overview The ftype command was introduced as a shell builtin to cmd.exe with t ...
* goto * if * keys * md *
mkdir The mkdir (make directory) command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, ...
*
mklink The NTFS file system defines various ways to redirect files and folders, e.g., to make a file point to another file or its contents without making a copy of it. The object being pointed to is called the target. Such file is called a hard or symbo ...
(introduced in Windows Vista) *
move Move may refer to: People * Daniil Move (born 1985), a Russian auto racing driver Brands and enterprises * Move (company), an online real estate company * Move (electronics store), a defunct Australian electronics retailer * Daihatsu Move Go ...
*
path A path is a route for physical travel – see Trail. Path or PATH may also refer to: Physical paths of different types * Bicycle path * Bridle path, used by people on horseback * Course (navigation), the intended path of a vehicle * Desire p ...
* pause * popd * prompt * pushd * rd * rem * ren * rename *
rmdir In computing, rmdir (or rd) is a command which will remove an empty directory on various operating systems. Implementations The command is available in Unix (e.g. macOS, Solaris, AIX, HP-UX), Unix-like (e.g. FreeBSD, Linux), DOS, Digital Resear ...
* set * setlocal * shift * start *
time Time is the continued sequence of existence and events that occurs in an apparently irreversible succession from the past, through the present, into the future. It is a component quantity of various measurements used to sequence events, ...
*
title A title is one or more words used before or after a person's name, in certain contexts. It may signify either generation, an official position, or a professional or academic qualification. In some languages, titles may be inserted between the f ...
* type *
ver Ver or VER may refer to: * Voluntary Export Restraints, in international trade * VER, the IATA airport code for General Heriberto Jara International Airport * Volk's Electric Railway, Brighton, England * VerPublishing, of the German group VDM P ...
*
verify CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS (typically residing ...
* vol


Windows CE

The following list of commands is supported by on Windows CE .NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0: * attrib * call * cd * chdir * cls * copy * date * del * dir * echo * erase * exit * goto *
help Help is a word meaning to give aid or signal distress. Help may refer to: Arts, entertainment, and media Films * ''Help'' (2010 film), a Bollywood horror film * ''Help'' (2021 theatrical film), a British psychological thriller film * '' ...
* if * md * mkdir * move * path * pause * prompt * pwd * rd * rem * ren * rename * rmdir * set * shift * start * time * title * type In addition, the command is available as an external command stored in .


ReactOS

The ReactOS implementation includes the following internal commands: * ? * alias * assoc *
beep The Blocks Extensible Exchange Protocol (BEEP) is a framework for creating network application protocols. BEEP includes building blocks like framing, pipelining, multiplexing, reporting and authentication for connection and message-oriented pe ...
* call * cd * chdir *
choice A choice is the range of different things from which a being can choose. The arrival at a choice may incorporate motivators and models. For example, a traveler might choose a route for a journey based on the preference of arriving at a give ...
* cls * color * copy * ctty * date * del * delete * delay * dir * dirs * echo * echos * echoerr * echoserr * endlocal * erase * exit * for * free * goto *
history History (derived ) is the systematic study and the documentation of the human activity. The time period of event before the invention of writing systems is considered prehistory. "History" is an umbrella term comprising past events as well ...
* if * memory * md * mkdir * mklink * move * path * pause * popd * prompt * pushd * rd * rmdir * rem * ren * rename * replace * screen * set * setlocal * shift * start * time * timer * title * type * ver * verify * vol


Comparison with COMMAND.COM

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 "Bad command or file name" is a common and ambiguous error message in MS-DOS and some other operating systems. COMMAND.COM, the primary user interface of MS-DOS, produces this error message when the first word of a command could not be interpreted ...
" (in the case of malformed commands) 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. (Under DOS this function was only available under
DR DOS DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
(through
HISTORY History (derived ) is the systematic study and the documentation of the human activity. The time period of event before the invention of writing systems is considered prehistory. "History" is an umbrella term comprising past events as well ...
) and later via an external component called .) * Adds rotating command-line completion for file and folder paths, where the user can cycle through results for the prefix using the , and for reverse direction. * Treats the
caret Caret is the name used familiarly for the character , provided on most QWERTY keyboards by typing . The symbol has a variety of uses in programming and mathematics. The name "caret" arose from its visual similarity to the original proofreade ...
character () as the escape character; the character following it is to be taken literally. There are special characters in and (e.g. "", "" 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 (Windows 2000 and later), fixing DOS idioms that made using
control structures In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an ''imp ...
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 In electrical engineering, a switch is an electrical component that can disconnect or connect the conducting path in an electrical circuit, interrupting the electric current or diverting it from one conductor to another. The most common type of ...
. * and commands limit the scope of changes to the environment. Changes made to the command line environment after commands are local to the
batch file Batch may refer to: Food and drink * Batch (alcohol), an alcoholic fruit beverage * Batch loaf, a type of bread popular in Ireland * A dialect term for a bread roll used in North Warwickshire, Nuneaton and Coventry, as well as on the Wirra ...
. command restores the previous settings. * The command allows subroutines within batch file. The command in only supports calling external batch files. * File name parser extensions to the command are comparable with
C shell The C shell (csh or the improved version, tcsh) is a Unix shell created by Bill Joy while he was a graduate student at University of California, Berkeley in the late 1970s. It has been widely distributed, beginning with the 2BSD release of th ...
. * The command can perform
expression evaluation A formula calculator is a software calculator that can perform a calculation in two steps: # Enter the calculation by typing it in from the keyboard. # Press a single button or key to see the final result. This is unlike button-operated calculato ...
. * 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 File Explorer, previously known as Windows Explorer, is a file manager application that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user interface for accessing the f ...
. * The conditional command can perform
case-insensitive In computers, case sensitivity defines whether uppercase and lowercase letters are treated as distinct (case-sensitive) or equivalent (case-insensitive). For instance, when users interested in learning about dogs search an e-book, "dog" and "Dog" a ...
comparisons and numeric equality and inequality comparisons in addition to case-sensitive string comparisons. (This was available in DR-DOS, but not in PC DOS or
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few ope ...
.)


See also

*
Comparison of command shells A command shell is a command-line interface to interact with and manipulate a computer's operating system. General characteristics Interactive features Background execution Background execution allows a shell to run a command without us ...
*
List of DOS commands This article presents a list of commands used by DOS operating systems, especially as used on x86-based IBM PC compatibles (PCs). Other DOS operating systems are not part of the scope of this list. In DOS, many standard system commands were pro ...
*
COMMAND.COM COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot (init proc ...
*
PowerShell PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-sou ...
*
Windows Terminal Windows Terminal is a multi-tabbed terminal emulator that Microsoft has developed for Windows 10 and later as a replacement for Windows Console. It can run any command-line app in a separate tab. It is preconfigured to run Command Prompt, Pow ...


References


Further reading

* *


External links

* * * * * {{Windows commands Command shells OS/2 command shells Windows command shells OS/2 commands OS/2 files Windows commands Windows files Windows components