中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-02 01:46
47,813 topics / 349,918 posts / today 0 new / 48,279 members
DOS批处理 & 脚本技术(批处理室) » How to output <%const a="b"%> with a batch file
Printable Version  1,047 / 5
Floor1 DebianGrub Posted 2010-04-01 18:46
初级用户 Posts 27 Credits 59
How do I use a batch file to output <%a="b"%>

Using
echo <%%const a="b"%%>>>c:\a.asp
gives an error.
But if I use echo "<%%const a="b"%%>">>c:\a.asp

it gets output as
"<%%const a="b"%%>"


How can I do it without the outermost double quotes?
Floor2 Hanyeguxing Posted 2010-04-01 19:47
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
  You must add the escape character ^ before the escape character ^, the concatenation character &, the pipe character |, the input redirection character <, and the output redirection characters > and >>.
Floor3 DebianGrub Posted 2010-04-02 09:25
初级用户 Posts 27 Credits 59
Fixed. But I solved it by writing it on separate lines.
If I want to write it on one line, what should I do?
echo ^<%%>>c:\a.asp
echo Const a="b">>c:\a.asp
echo %%^>>>c:\a.asp

Writing it on separate lines like above works. But if I put it all on one line, it doesn't work.

echo ^<%%const a="b"%%^>>>c:\a.asp
Floor4 Hanyeguxing Posted 2010-04-02 12:19
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Running echo ^<%%const a="b"%%^>>>c:\a.asp
in a batch file outputs <%const a="b"%>
How come it doesn't work?
Floor5 DebianGrub Posted 2010-04-06 10:41
初级用户 Posts 27 Credits 59
Did you try what the poster above said?
Floor6 Hanyeguxing Posted 2010-04-06 12:41
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
What system are you running it under?
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023