中国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-08-05 16:53
48,039 topics / 350,124 posts / today 2 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » Why do several lines redirected to a file leave only the last line?
Printable Version  746 / 4
Floor1 5548646 Posted 2007-08-28 22:29
初级用户 Posts 28 Credits 81
echo "regedit 4">1.reg
echo>1.reg
echo "QQ1"="c:\欢迎.bat">1.reg


After I entered this BAT, why does the output 1.reg only contain the last line, "QQ1"="c:\欢迎.bat">1.reg?

[ Last edited by lxmxn on 2007-9-9 at 02:12 AM ]
Floor2 bbq5201 Posted 2007-08-28 22:39
初级用户 Posts 51 Credits 136
Originally posted by 5548646 at 2007-8-28 10:29 PM:
echo "regedit 4">1.reg
echo>1.reg
echo "QQ1"="c:\欢迎.bat">1.reg


After I entered this ...



Try it like this
echo "regedit 4">1.reg
echo >>1.reg
echo "QQ1"="c:\欢迎.bat">>1.reg
Floor3 slore Posted 2007-08-28 22:46
铂金会员 Posts 2,478 Credits 5,212
REGEDIT4
Also, you need to leave 1 blank line
Floor4 HAT Posted 2007-08-29 15:07
版主 Posts 5,017 Credits 9,023
Floor5 5548646 Posted 2007-08-29 18:11
初级用户 Posts 28 Credits 81
I forgot it was >>, hehe. Thanks, everyone.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023