CMD.EXE (OS 2)
   HOME

TheInfoList



OR:

cmd.exe, a.k.a. Command Prompt, is a
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses Science Biology * Seashell, a hard outer layer of a marine ani ...
program on later versions of
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
( NT and CE families),
OS/2 OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
,,
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 hardwa ...
,
ArcaOS ArcaOS is a Proprietary software, proprietary operating system based on OS/2, developed and marketed by Arca Noae, LLC under license from IBM. It was first released in 2017 and builds on OS/2 Warp 4.52 by adding support for new hardware, fixing ...
, and
ReactOS ReactOS is a Free and open-source software, free and open-source operating system for i586/amd64 personal computers that is intended to be binary-code compatibility, binary-compatible with computer programs and device drivers developed for Wind ...
. In some versions of Windows ( CE .NET 4.2, CE 5.0 and Embedded CE 6.0) it is referred to as the Command Processor Shell. Implementation differs between operating systems, but with significant consistency of behavior and available commands. Older, related operating systems,
DOS DOS (, ) is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible syste ...
and
Windows 9x Windows 9x is a generic term referring to a line of discontinued Microsoft Windows operating systems released from 1995 to 2000 and supported until 2006, which were based on the kernel introduced in Windows 95 and modified in succeeding version ...
, provided as the shell. replaced in the Windows product line with the introduction of NT. Current versions of Windows include
PowerShell PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langu ...
as an alternative shell that runs side-by-side with . 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 . The ReactOS implementation of is derived from FreeCOM, the
FreeDOS FreeDOS (formerly 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 system, legacy software and supporting embedded systems. FreeDOS ca ...
command line interpreter.


Use


Desktop integration

In Windows, the shell is presented in the
desktop A desktop traditionally refers to: * The surface of a desk (often to distinguish office appliances that fit on a desk, such as photocopiers and printers, from larger equipment covering its own area on the floor) Desktop may refer to various compu ...
via
Windows Terminal Windows Terminal is a Tabbed, multi-tabbed terminal emulator developed by Microsoft 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 Windows Command Pro ...
or on older versions via
Windows Console Windows Console is a GUI application for running console applications in Windows. Windows Console is used for running text-based programs such as operating system shells (e.g. Command Prompt and PowerShell), utilities (e.g. Far Manager) an ...
.


Concurrent piping

In OS/2 and Windows, the shell supports
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-circu ...
to allow both sides of a pipeline to run concurrently. As a result, it is possible to redirect the standard error stream. In contrast, uses temporary files, and runs the two sides serially, one after the other.


Command separator

Multiple commands can be included in a single line using the command separator or . With the separator, a subsequent command is executed even if the previous command indicates an error. In the following example, each of the three commands is executed, one after the other, and regardless of their result code. >CommandA & CommandB & CommandC With the separator, a command must complete successfully for the subsequent command to execute. In the following example, only executes if completes successfully, and only executes if also completes successfully. >CommandA && CommandB && CommandC


Command line limit

The shell limits the length of a command line which includes entered text, individual
environment variable An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the va ...
s that are inherited by other processes, and all environment variable expansions 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 successor to Windows 2000 for high-end and business users a ...
and later, the maximum length is 8191 (213-1) characters. On earlier versions, such as
Windows 2000 Windows 2000 is a major release of the Windows NT operating system developed by Microsoft, targeting the server and business markets. It is the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RT ...
or Windows NT 4.0, the maximum length is 2047 (211-1) characters.


Escaping special characters

The shell reserves the following characters as special: &<>[]^=;!'+,`~ and whitespace character, whitespace. In some cases, an argument that contains such characters must be enclosed in double quotes to escape from the special character handling. For example: >echo me & you me 'you' is not recognized as an internal or external command, operable program or batch file. >echo "me & you" "me & you"


Internal commands

The following sections list
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 for implementations of the shell on various operating systems.


OS/2

Internal commands in OS/2: * break * chcp * cd * chdir * cls * copy * date *
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 *
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 A ...
*
for For or FOR may refer to: English language *For, a preposition *For, a complementizer *For, a grammatical conjunction Science and technology * Fornax, a constellation * for loop, a programming language statement * Frame of reference, in physics * ...
* goto * if * md *
mkdir (make directory) command (computing), command in the Unix, DOS, Digital Research, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory (file systems), directory. It is also available in the Unified ...
*
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 * Desir ...
* 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 ...
*
set Set, The Set, SET or SETS may refer to: Science, technology, and mathematics Mathematics *Set (mathematics), a collection of elements *Category of sets, the category whose objects and morphisms are sets and total functions, respectively Electro ...
* shift *
start Start can refer to multiple topics: * Takeoff, the phase of flight where an aircraft transitions from moving along the ground to flying through the air * Starting lineup in sports * Track and field#Starts use in race, Starts use in sport race * S ...
*
time Time is the continuous progression of existence that occurs in an apparently irreversible process, irreversible succession from the past, through the present, and into the future. It is a component quantity of various measurements used to sequ ...
*
type Type may refer to: Science and technology Computing * Typing, producing text via a keyboard, typewriter, etc. * Data type, collection of values used for computations. * File type * TYPE (DOS command), a command to display contents of a file. * ...
* ver *
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 residi ...
* vol


Windows NT family

Internal commands in Windows NT and later: * assoc * break *
call Call or Calls may refer to: Arts, entertainment, and media Games * Call (poker), a bet matching an opponent's * Call, in the game of contract bridge, a bid, pass, double, or redouble in the bidding stage Music and dance * Call (band), from L ...
* cd * chdir * cls * color * copy * date *
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 *
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 A ...
*
for For or FOR may refer to: English language *For, a preposition *For, a complementizer *For, a grammatical conjunction Science and technology * Fornax, a constellation * for loop, a programming language statement * Frame of reference, in physics * ...
* ftype * goto *
help Help may refer to: Arts, entertainment, and media Films * Help (2010 film), ''Help'' (2010 film), a Bollywood horror film * Help (2021 theatrical film), ''Help'' (2021 theatrical film), a British psychological thriller film * Help (2021 TV ...
* if * keys * md *
mkdir (make directory) command (computing), command in the Unix, DOS, Digital Research, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory (file systems), directory. It is also available in the Unified ...
* mklink *
move Move or The Move may refer to: Brands and enterprises * Move (company), an American online real estate company * Move (electronics store), a defunct Australian electronics retailer * Daihatsu Move, a Japanese car * PlayStation Move, a motion ...
*
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 * Desir ...
* 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 ...
*
set Set, The Set, SET or SETS may refer to: Science, technology, and mathematics Mathematics *Set (mathematics), a collection of elements *Category of sets, the category whose objects and morphisms are sets and total functions, respectively Electro ...
* setlocal * shift *
start Start can refer to multiple topics: * Takeoff, the phase of flight where an aircraft transitions from moving along the ground to flying through the air * Starting lineup in sports * Track and field#Starts use in race, Starts use in sport race * S ...
*
time Time is the continuous progression of existence that occurs in an apparently irreversible process, irreversible succession from the past, through the present, and into the future. It is a component quantity of various measurements used to sequ ...
*
title A title is one or more words used before or after a person's name, in certain contexts. It may signify their generation, official position, military rank, professional or academic qualification, or nobility. In some languages, titles may be ins ...
*
type Type may refer to: Science and technology Computing * Typing, producing text via a keyboard, typewriter, etc. * Data type, collection of values used for computations. * File type * TYPE (DOS command), a command to display contents of a file. * ...
* ver *
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 residi ...
* vol


Windows CE

Internal commands in Windows CE .NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0: *
attrib In computing, ATTRIB is a command in Intel ISIS-II, DOS, IBM OS/2, Microsoft Windows and ReactOS that allows the user to change various characteristics, or " attributes" of a computer file or directory. The command is also available in the EFI ...
* call * cd * chdir * cls * copy * date * del * dir * echo * erase * exit * goto *
help Help may refer to: Arts, entertainment, and media Films * Help (2010 film), ''Help'' (2010 film), a Bollywood horror film * Help (2021 theatrical film), ''Help'' (2021 theatrical film), a British psychological thriller film * Help (2021 TV ...
* if * md * mkdir * move * path * pause * prompt *
pwd pwd (print working directory) is a shell command that reports the working directory path to standard output. Although often associated with Unix, its predecessor Multics had a pwd command (which was a short name of the print_wdir command) from ...
* rd * rem * ren * rename * rmdir * set * shift * start * time * title * type The command is available as an external command.


ReactOS

Internal commands in ReactOS: * ? * alias * assoc * beep * 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 Motivation, motivators and Choice modelling, models. Freedom of choice is generally cherished, whereas a severely limited or arti ...
* cls * color * copy * ctty * date * del * delete * delay * dir * dirs * echo * echos * * * endlocal * erase * exit * for * free * goto *
history History is the systematic study of the past, focusing primarily on the Human history, human past. As an academic discipline, it analyses and interprets evidence to construct narratives about what happened and explain why it happened. Some t ...
* 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, provides various
user experience User experience (UX) is how a user interacts with and experiences a product, system or service. It includes a person's perceptions of utility, ease of use, and efficiency. Improving user experience is important to most companies, designers, a ...
enhancments as compared to , including: * More detailed error reporting for malformed commands than the generic " Bad command or file name". In OS/2, errors are reported in the chosen language of the system, their text being taken from the system message files. The
HELP Help may refer to: Arts, entertainment, and media Films * Help (2010 film), ''Help'' (2010 film), a Bollywood horror film * Help (2021 theatrical film), ''Help'' (2021 theatrical film), a British psychological thriller film * Help (2021 TV ...
command can then be issued with the error message number to obtain further information. * Supports using of arrow keys to scroll through command history. With , this functionality was only available in DR DOS; via
HISTORY History is the systematic study of the past, focusing primarily on the Human history, human past. As an academic discipline, it analyses and interprets evidence to construct narratives about what happened and explain why it happened. Some t ...
) 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 proofre ...
character () as the
escape character In computing and telecommunications, an escape character is a character that invokes an alternative interpretation on the following characters in a character sequence. An escape character is a particular case of metacharacters. Generally, the ...
; 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 (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 '' ...
hard and complex. The extensions can be disabled, providing a stricter compatibility mode. * The DELTREE command was merged into the rd command via the
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 o ...
. * and commands limit the scope of changes to the environment. Changes made to the command line environment after are local to the
batch file A batch file is a Scripting language, script file in DOS, OS/2 and Microsoft Windows. It consists of a series of Command (computing), commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain a ...
. restores the previous settings. * The command allows subroutines within batch file. The command 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 the ...
. * The command can perform expression evaluation. * An expansion of the
for For or FOR may refer to: English language *For, a preposition *For, a complementizer *For, a grammatical conjunction Science and technology * Fornax, a constellation * for loop, a programming language statement * Frame of reference, in physics * ...
command supports parsing files and arbitrary sets in addition to file names. * The new pushd and popd 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 and default desktop environment that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user i ...
. * 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 ...
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 PC or pc may refer to: Arts and entertainment * Player character or playable character, a fictional character controlled by a human player, usually in role-playing games or computer games * '' Port Charles'', an American daytime TV soap opera * ...
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 op ...
.


See also

* *


References


Further reading

* *


External links

* * * * *
Most important CMD commands in Windows - colorconsole.de
{{Windows commands Command shells OS/2 command shells Windows command shells OS/2 commands OS/2 files Windows commands Windows files Windows components