Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [18:52:26] <Biohazard> Starts a new instance of the Windows command interpreter
- [18:52:26] <Biohazard> CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
- [18:52:26] <Biohazard> [[/S] [/C | /K] string]
- [18:52:26] <Biohazard> /C Carries out the command specified by string and then terminates
- [18:52:26] <Biohazard> /K Carries out the command specified by string but remains
- [18:52:26] <Biohazard> /S Modifies the treatment of string after /C or /K (see below)
- [18:52:26] <Biohazard> /Q Turns echo off
- [18:52:26] <Biohazard> /D Disable execution of AutoRun commands from registry (see below)
- [18:52:26] <Biohazard> /A Causes the output of internal commands to a pipe or file to be ANSI
- [18:52:26] <Biohazard> /U Causes the output of internal commands to a pipe or file to be
- [18:52:26] <Biohazard> Unicode
- [18:52:26] <Biohazard> /T:fg Sets the foreground/background colors (see COLOR /? for more info)
- [18:52:26] <Biohazard> /E:ON Enable command extensions (see below)
- [18:52:26] <Biohazard> /E:OFF Disable command extensions (see below)
- [18:52:26] <Biohazard> /F:ON Enable file and directory name completion characters (see below)
- [18:52:26] <Biohazard> /F:OFF Disable file and directory name completion characters (see below)
- [18:52:26] <Biohazard> /V:ON Enable delayed environment variable expansion using ! as the
- [18:52:26] <Biohazard> delimiter. For example, /V:ON would allow !var! to expand the
- [18:52:26] <Biohazard> variable var at execution time. The var syntax expands variables
- [18:52:26] <Biohazard> at input time, which is quite a different thing when inside of a FOR
- [18:52:26] <Biohazard> loop.
- [18:52:26] <Biohazard> /V:OFF Disable delayed environment expansion.
- [18:52:26] <Biohazard> Note that multiple commands separated by the command separator '&&'
- [18:52:26] <Biohazard> are accepted for string if surrounded by quotes. Also, for compatibility
- [18:52:26] <Biohazard> reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the
- [18:52:26] <Biohazard> same as /C. Any other switches are ignored.
- [18:52:26] <Biohazard> If /C or /K is specified, then the remainder of the command line after
- [18:52:26] <Biohazard> the switch is processed as a command line, where the following logic is
- [18:52:26] <Biohazard> used to process quote (") characters:
- [18:52:26] <Biohazard> 1. If all of the following conditions are met, then quote characters
- [18:52:26] <Biohazard> on the command line are preserved:
- [18:52:26] <Biohazard> - no /S switch
- [18:52:26] <Biohazard> - exactly two quote characters
- [18:52:26] <Biohazard> - no special characters between the two quote characters,
- [18:52:26] <Biohazard> where special is one of: &<>()@^|
- [18:52:26] <Biohazard> - there are one or more whitespace characters between the
- [18:52:26] <Biohazard> two quote characters
- [18:52:26] <Biohazard> - the string between the two quote characters is the name
- [18:52:26] <Biohazard> of an executable file.
- [18:52:26] <Biohazard> 2. Otherwise, old behavior is to see if the first character is
- [18:52:26] <Biohazard> a quote character and if so, strip the leading character and
- [18:52:26] <Biohazard> remove the last quote character on the command line, preserving
- [18:52:26] <Biohazard> any text after the last quote character.
- [18:52:26] <Biohazard> If /D was NOT specified on the command line, then when CMD.EXE starts, it
- [18:52:26] <Biohazard> looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
- [18:52:26] <Biohazard> either or both are present, they are executed first.
- [18:52:26] <Biohazard> HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
- [18:52:26] <Biohazard> and/or
- [18:52:26] <Biohazard> HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
- [18:52:26] <Biohazard> Command Extensions are enabled by default. You may also disable
- [18:52:26] <Biohazard> extensions for a particular invocation by using the /E:OFF switch. You
- [18:52:26] <Biohazard> can enable or disable extensions for all invocations of CMD.EXE on a
- [18:52:26] <Biohazard> machine and/or user logon session by setting either or both of the
- [18:52:26] <Biohazard> following REG_DWORD values in the registry using REGEDIT.EXE:
- [18:52:26] <Biohazard> HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions
- [18:52:26] <Biohazard> and/or
- [18:52:26] <Biohazard> HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions
- [18:52:26] <Biohazard> to either 0x1 or 0x0. The user specific setting takes precedence over
- [18:52:26] <Biohazard> the machine setting. The command line switches take precedence over the
- [18:52:26] <Biohazard> registry settings.
- [18:52:26] <Biohazard> In a batch file, the SETLOCAL ENABLEEXTENSIONS or DISABLEEXTENSIONS arguments
- [18:52:26] <Biohazard> takes precedence over the /E:ON or /E:OFF switch. See SETLOCAL /? for details.
- [18:52:26] <Biohazard> The command extensions involve changes and/or additions to the following
- [18:52:26] <Biohazard> commands:
- [18:52:26] <Biohazard> DEL or ERASE
- [18:52:26] <Biohazard> COLOR
- [18:52:26] <Biohazard> CD or CHDIR
- [18:52:26] <Biohazard> MD or MKDIR
- [18:52:26] <Biohazard> PROMPT
- [18:52:26] <Biohazard> PUSHD
- [18:52:26] <Biohazard> POPD
- [18:52:26] <Biohazard> SET
- [18:52:26] <Biohazard> SETLOCAL
- [18:52:26] <Biohazard> ENDLOCAL
- [18:52:26] <Biohazard> IF
- [18:52:26] <Biohazard> FOR
- [18:52:26] <Biohazard> CALL
- [18:52:26] <Biohazard> SHIFT
- [18:52:26] <Biohazard> GOTO
- [18:52:26] <Biohazard> START (also includes changes to external command invocation)
- [18:52:26] <Biohazard> ASSOC
- [18:52:26] <Biohazard> FTYPE
- [18:52:26] <Biohazard> To get specific details, type commandname /? to view the specifics.
- [18:52:26] <Biohazard> Delayed environment variable expansion is NOT enabled by default. You
- [18:52:26] <Biohazard> can enable or disable delayed environment variable expansion for a
- [18:52:26] <Biohazard> particular invocation of CMD.EXE with the /V:ON or /V:OFF switch. You
- [18:52:26] <Biohazard> can enable or disable delayed expansion for all invocations of CMD.EXE on a
- [18:52:26] <Biohazard> machine and/or user logon session by setting either or both of the
- [18:52:26] <Biohazard> following REG_DWORD values in the registry using REGEDIT.EXE:
- [18:52:26] <Biohazard> HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\DelayedExpansion
- [18:52:26] <Biohazard> and/or
- [18:52:26] <Biohazard> HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DelayedExpansion
- [18:52:26] <Biohazard> to either 0x1 or 0x0. The user specific setting takes precedence over
- [18:52:27] <Biohazard> the machine setting. The command line switches take precedence over the
- [18:52:27] <Biohazard> registry settings.
- [18:52:27] <Biohazard> In a batch file the SETLOCAL ENABLEDELAYEDEXPANSION or DISABLEDELAYEDEXPANSION
- [18:52:27] <Biohazard> arguments takes precedence over the /V:ON or /V:OFF switch. See SETLOCAL /?
- [18:52:27] <Biohazard> for details.
- [18:52:27] <Biohazard> If delayed environment variable expansion is enabled, then the exclamation
- [18:52:27] <Biohazard> character can be used to substitute the value of an environment variable
- [18:52:27] <Biohazard> at execution time.
- [18:52:27] <Biohazard> You can enable or disable file name completion for a particular
- [18:52:27] <Biohazard> invocation of CMD.EXE with the /F:ON or /F:OFF switch. You can enable
- [18:52:27] <Biohazard> or disable completion for all invocations of CMD.EXE on a machine and/or
- [18:52:27] <Biohazard> user logon session by setting either or both of the following REG_DWORD
- [18:52:27] <Biohazard> values in the registry using REGEDIT.EXE:
- [18:52:27] <Biohazard> HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar
- [18:52:27] <Biohazard> HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar
- [18:52:27] <Biohazard> and/or
- [18:52:27] <Biohazard> HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar
- [18:52:27] <Biohazard> HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar
- [18:52:27] <Biohazard> with the hex value of a control character to use for a particular
- [18:52:27] <Biohazard> function (e.g. 0x4 is Ctrl-D and 0x6 is Ctrl-F). The user specific
- [18:52:27] <Biohazard> settings take precedence over the machine settings. The command line
- [18:52:27] <Biohazard> switches take precedence over the registry settings.
- [18:52:27] <Biohazard> If completion is enabled with the /F:ON switch, the two control
- [18:52:27] <Biohazard> characters used are Ctrl-D for directory name completion and Ctrl-F for
- [18:52:27] <Biohazard> file name completion. To disable a particular completion character in
- [18:52:27] <Biohazard> the registry, use the value for space (0x20) as it is not a valid
- [18:52:27] <Biohazard> control character.
- [18:52:27] <Biohazard> Completion is invoked when you type either of the two control
- [18:52:27] <Biohazard> characters. The completion function takes the path string to the left
- [18:52:27] <Biohazard> of the cursor appends a wild card character to it if none is already
- [18:52:27] <Biohazard> present and builds up a list of paths that match. It then displays the
- [18:52:27] <Biohazard> first matching path. If no paths match, it just beeps and leaves the
- [18:52:27] <Biohazard> display alone. Thereafter, repeated pressing of the same control
- [18:52:27] <Biohazard> character will cycle through the list of matching paths. Pressing the
- [18:52:27] <Biohazard> Shift key with the control character will move through the list
- [18:52:27] <Biohazard> backwards. If you edit the line in any way and press the control
- [18:52:27] <Biohazard> character again, the saved list of matching paths is discarded and a new
- [18:52:27] <Biohazard> one generated. The same occurs if you switch between file and directory
- [18:52:27] <Biohazard> name completion. The only difference between the two control characters
- [18:52:27] <Biohazard> is the file completion character matches both file and directory names,
- [18:52:27] <Biohazard> while the directory completion character only matches directory names.
- [18:52:27] <Biohazard> If file completion is used on any of the built in directory commands
- [18:52:27] <Biohazard> (CD, MD or RD) then directory completion is assumed.
- [18:52:27] <Biohazard> The completion code deals correctly with file names that contain spaces
- [18:52:27] <Biohazard> or other special characters by placing quotes around the matching path.
- [18:52:27] <Biohazard> Also, if you back up, then invoke completion from within a line, the
- [18:52:27] <Biohazard> text to the right of the cursor at the point completion was invoked is
- [18:52:27] <Biohazard> discarded.
- [18:52:27] <Biohazard> The special characters that require quotes are:
- [18:52:27] <Biohazard> <space>
- [18:52:27] <Biohazard> &()[]{}^=;!'+,`~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement