If you want to use special characters in your echo statement, use the ^ character before the special character. If you want to escape the % character in an echo statement double the % like:

Script Test.bat
echo %%1
C:\Test.bat “C:\Program Files”
“C:\Program Files”

Escape character (http://www.ss64.com/nt/setlocal.html)
Adding the escape character before a command symbol     allows it to be treated as ordinary text.
When piping or redirecting any of these charcters you should
prefix with the escape character: \ & | > < ^
e.g.  ^\  ^&  ^|  ^>  ^<  ^^

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.