在批处理写段时必须写回声5次?

时间:2016-01-15 16:29:48

标签: batch-file

1.批量写段落必须写回声5次或者可以做1次吗?回声(段落)  我是新来的,我喜欢&感谢所有

2 个答案:

答案 0 :(得分:1)

我认为这是你要做的,但我不确定

@echo off
setlocal enabledelayedexpansion
:: Set end of line
for /f %%A in ('copy /Z "%~dpf0" nul') do set EOL=%%A^


:: Two empty lines are neccessary

echo This is line 1.!EOL!This is line 2.!EOL!This is line 3.

pause

这是输出。

This is line 1.
This is line 2.
This is line 3.
Press any key to continue . . .

答案 1 :(得分:1)

你可以这样做:

@echo off

set x=first line;second line
echo %x:;=&echo %