echo Test1echo one ^two ^three ^four^*--- Output ---Test1one two three four*
echo Test2echo one & echo two--- Output ---Test2onetwo
echo Test3echo one & ^echo two--- Output ---Test3onetwo
echo Test4echo one ^& echo two--- Output ---Test4one & echo two
要抑制下一个字符的转义,您可以使用重定向。
重定向必须在插入符号之前。但是在插入符号之前存在一个重定向的好奇心。
如果在插入符号处放置标记,则标记将被删除。
echo Test5echo one <nul ^& echo two--- Output ---Test5onetwo
echo Test6echo one <nul ThisTokenIsLost^& echo two--- Output ---Test6onetwo
并且也可以将嵌入换行符插入字符串:
setlocal EnableDelayedExpansionset text=This creates ^
a line feedecho Test7: %text%echo Test8: !text!--- Output ---Test7: This createsTest8: This createsa line feed