CMD [ /A | /U ] [ /Q ] [ /D ] [ /E: |
/C or /R |
Multiple commands separated by && must be enclosed in quotes.
If
quote characters on the command line are preserved if
Otherwise, if the first character is a quote character, it is stripped out and
the last quote character in the command line is removed
If
The command extensions involve changes and/or additions to the following
/C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic is
used to process quote (") characters:
/S switch
& < > ( ) @ ^ | ) are between the two quote characters
/D* was NOT specified on the command line, CMD starts by
looksing for REG_SZ/REG_EXPAND_SZ registry variables, they are executed first.
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
and/or
HKEY_CURRENT_USER\" "
Command Extensions are enabled unless disabled by /E:OFF .
To enable or disable extensions for all invocations of CMD :
to HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions
and/or
HKEY_CURRENT_USER\" "
1 or 0.
The user specific setting takes precedence over the machine setting.
The command line switches take precedence over the registry settings.
DEL or ERASE
COLOR, CD or CHDIR, MD or MKDIR, PROMPT, PUSHD, POPD, SET, SETLOCAL, ENDLOCAL, IF,
FOR, CALL, SHIFT, GOTO, START (also includes changes to external command invocation), ASSOC, FTYPE
commandname /? to view the specifics.
Delayed environment variable expansion*
is NOT enabled by default.
To enable or disable it for a
particular invocation of CMD use /V:ON or /V:OFF
To enable or disable it for all invocations of CMD
modify REG_DWORD values in the registry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\DelayedExpansion
HKEY_CURRENT_USER\" "
1 or 0. The user specific setting takes precedence over
the machine setting. The command line switches take precedence over the
registry settings.
If delayed environment variable expansion is enabled, then ! can be used to substitute the value of an environment variable at execution time.
File and Directory name completion is NOT enabled by default.
To enable or disable file name completion for a particular invocation of
CMD use /F:ON or /F:OFF .
To enable or disable completion for all invocations of CMD modify the registry :
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar
or
HKEY_LOCAL_MACHINE\...\PathCompletionChar
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar
or
HKEY_CURRENT_USER\...\PathCompletionChar
with the hex value of a control character to use for a particular
function (e.g. 4 is Ctrl-D and 06 is Ctrl-F
The user precedence over machine, command line switches over registry .
If completion is enabled with the /F:ON , the two control
characters used are Ctrl-D for directory name completion and Ctrl-F for
file name completion.
To disable a completion character in the registry, use the value for space (0x20) .
Completion is invoked when you type either control
characters. It takes the path string to the left
of the cursor, appends a wild card character to it ( if none is already
present ), builds up a list of paths that match then displays the
first matching path. If no paths match, it beeps. repeated pressing of the same control
character cycles through the list of matching paths. Use
Shift with the control character to move through the list
backwards. If you edit the line, or switch between file and directory
name completion, and press the control
character , the saved list of matching paths is discarded and a new
one generated. File completion matches both file and directory names,
while the directory completion only matches directory names.
If file completion is used on any of the built in directory commands
(CD, MD or RD) then directory completion is assumed.
The completion code deals with names that contain spaces or special characters by placing quotes around the matching path. If you back up, then invoke completion from within a line, the text to the right of the cursor at the point completion was invoked is discarded.