DOS command line/batch escape character 

Joined:
04/09/2007
Posts:
753

June 11, 2010 19:04:18    Last update: June 11, 2010 19:06:35
The caret ^ is DOS command line escape character.

Example 1: echo < and > as is, not interpreting them as input/output redirect.
@rem sign an XML file. Requires Java class utils.xmlsig.SignXMLFile.
@echo off
if "%2" == "" goto usage
java -Xms256m -Xmx512m utils.xmlsig.SignXMLFile %1 %2
goto end

:usage
echo Usage: %0 ^<inputFile^> ^<outputFile^>
echo.

:end


Example 2: treat & literally, not as the special character to combine two commands.
@rem search "dos command line" in Google.
curl http://www.google.com/search?hl=en^&q=dos+command+line -o google.html

Add switch -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1" to make curl look like Firefox.
Share |
| Comment  | Tags