If you are passing a parameter to a batch file that contains any of these delimiter characters, it will split the parameter into two parameters unless you surround the whole thing with double quotes: "this is;one=param," Show Notice that although / and - are commonly used to separate command options, they are absent from the list above. This is because batch file parameters are passed to CMD.exe which can accept it's own parameters (which are invoked using / and - ) The default token delimiters in a FOR IN() clause are the same as on the command line but the delims= option is available to specify something different. When FOR /F is used to process a string, the default delimters are Space and TAB. When using the TAB character as a delimiter be aware that many text editors will insert a TAB as a series of SPACEs. If you use %* to refer to all parameters, the value returned will include the delimiters. ^ Escape character. Escape and the pipeline
Escaping CR/LF line endings.
Escaping Percents
Escape the Escape character
Special Cases
Using "Double Quotes"
Removing Quotes
Working without Quotes
@ECHO OFF SET _params=%* :: pass params to a subroutine CALL :sub "%_params%" GOTO :eof :sub :: Now display just the filename (not path) ECHO %~n1 “All the best stories in the world are but one story in reality - the story of escape. It is the only thing which interests us all and at all times, how to escape” ~ A. C. Benson |