China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 07:06
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Question about echo and & View 931 Replies 2
Original Poster Posted 2009-08-10 04:32 ·  中国 河南 郑州 联通
新手上路
Credits 7
Posts 10
Joined 2006-01-09 16:15
20-year member
UID 48691
Gender Male
Status Offline
Please look at the following batch file:
echo 123&pause>>123.bat


What I want from this line is to generate a 123.bat file whose content is: 123&pause
But in reality what I got was a 123.bat file whose content is: Press any key to continue . . .

How can I keep & from executing? How should this line be modified?
Floor 2 Posted 2009-08-10 05:12 ·  中国 天津 联通
高级用户
★★★
据说是李先生
Credits 609
Posts 400
Joined 2008-04-23 15:55
18-year member
UID 116706
Gender Male
Status Offline
Use the escape character ^


echo 123^&pause>>123.bat
Floor 3 Posted 2009-08-10 05:36 ·  中国 河南 郑州 联通
新手上路
Credits 7
Posts 10
Joined 2006-01-09 16:15
20-year member
UID 48691
Gender Male
Status Offline
Thanks
Forum Jump: