答案 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 %