标题: 怎么样才能让dos中的echo命令输出时不自动追加换行?
[打印本页]
作者: kingkinglh
时间: 2007-10-25 14:15
标题: 怎么样才能让dos中的echo命令输出时不自动追加换行?
在用 for /l %%d in (1,1,6) do echo %%d>>a.txt
会生成一个内容如下的
1
2
3
4
5
6
a.txt文件,那么怎么样才能用for /l 命令生成一个内容为
123456
的a.txt文件?
也就是说怎么样才能让ECHO的自动换行功能在需要的时候出现,不需要的时候将其关闭!
作者: ssikiki
时间: 2008-4-7 22:56
setlocal enabledelayedexpansion
set str=
for /l %%d in (1,1,6) do set str=!str!%%d
echo !str!
pause
作者: 9527
时间: 2008-4-7 23:32
for /l %a in (1,1,6) do @<nul,set/p=%a
作者: abcd
时间: 2008-4-7 23:35
95还是蛮不坏的嘛,o(∩_∩)o...哈哈
作者: chishingchan
时间: 2008-4-10 21:41
标题: 可参考这贴
http://www.cn-dos.net/forum/view ... ght=%2Bchishingchan