How to write an XML tag with double quotes using command prompt echo command

为君一笑 提交于 2019-11-29 15:33:50
Mathiou

the characters you want to escape are not the " but the <.
Then the correct syntax is this one :

C:\>echo ^<tag variable="value"^>

Shouldn't you use the "\" char to escape a double quote ? Like "echo "< tag blabla=\"value\" >" ?

EDIT

Seems like :

echo ^<tag variable=^"value^"^> 

works fine !

try with delayed expansion:

setlocal enableDelayedExpansion
set "tag_line=<tag variable="value">"
echo !tag_line!
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!