> Commands A-M
> Commands Ch-Cz
Starts a new instance of the NT command interpreter.
A command interpreter is a program that lets you type commands.
Use the EXIT command to stop
the new command interpreter and return control to the old one.
| [/K command]]
- Display help.
- Output ANSI Characters.
- /C command
- Specifies that the command interpreter is to perform the
specified command and then exit. This switch must be the last
switch on the command-line.
- /R same as /C.
- Ignore registry AUTORUN commands (HKLM | HKCU
- /F: [ON | OFF]
- Enable/disable auto-completion of pathnames entered at the
CMD prompt. /F:OFF is the default.
- At the command prompt CTRL-D (^D) gives folder name completion
and CTRL-F (^F) gives file and folder name completion.
- These CTRL keys build up a list of paths that match and
display the first matching path. Thereafter, repeated pressing
of the same control key will cycle through the list of
matching paths. Pressing SHIFT with the control KEY will move
through the list backwards.
- /K command
- Runs the specified command, program, or batch program and then
displays the NT command prompt. This switch must be the
last switch on the command-line.
- Turns echo off.
- Strips quotes from command string.
- Sets the foreground/background colours. See
for a list of colour codes.
- Output UNICODE Characters.
- /V: [ON | OFF]
- Enable/disable delayed environment variable expansion.
(This allows a FOR loop to
specify !variable! instead of %variable% expanding the
variable at execution time instead of at input time).
- Environment expansion preference can be set permanently
in the registry HKLM | HKCU
Set to either 0x1 or 0x0
- /E: [ON | OFF]
- Enable/disable extensions to CMD.EXE.
- /X same as /E:ON.
- /Y same as /E:OFF.
- Command Extensions are enabled by default unless you are
running a 16-bit script (command.com or a .BAT file) in which
case they are not available at all.
- Command extensions are controlled by setting a value in
the registry (HKCU
0 = disable extensions, 1 = enable extensions
EXIT - Use this to close a CMD
shell and return.
CALL - Call one batch program
START - Start a separate window to run a
specified program or command
DOSKEY Edit command-line, recall commands
Equivalent Linux BASH commands:
builtin - Run a shell builtin
bash - run the bash shell
chroot - Run a command with a different root directory
csh - run the C shell
exec - Execute a command
ksh - run the Korn shell
sh - run the Bourne shell
CMD.exe is the NT equivalent of
Command.com in previous
operating systems. The older 16-bit command processor
command.com is supplied to provide backward compatibility for
16-bit DOS applications.
To ensure that an NT batch file will not run if
accidentally copied to a Windows 95/98/ME machine you should
use the extension .CMD rather than .BAT.
The %COMSPEC% environment
variable will show if you are running CMD.EXE or command.com.
It is possible to run the Windows 2000 CMD.EXE under NT
The environment Variable
%CMDCMDLINE% will expand into the
original command-line passed to CMD.EXE.
Under Windows NT, the command-line is limited to 256
characters. The command processor was patched from NT 4
Service Pack 4 to prevent this limitation from causing a stack
Multiple commands separated by the command separator
'&&' are accepted if surrounded by quotes.
This logic is used to process quote (") characters:
- If all of the conditions are met, then quote
characters on the command-line are preserved:
- no /S switch
- exactly two quote characters
- no special characters between the two quote characters,
where special is one of: &<>()@^|
- there are one or more whitespace characters between the
the two quote characters
- the string between the two quote characters is the name
of an executable file.
- Otherwise, old behavior is to see if the first character is
a quote character and if so, strip the leading character and
remove the last quote character on the command-line, preserving
any text after the last quote character.
The key combination ALT-ENTER will switch a CMD window to
full-screen mode. Press ALT-ENTER again to return to a normal
- Windows NT