Come puoi inserire un newline nell'output del tuo file batch?
Voglio fare qualcosa come
echo hello\nworld
Che produrrebbe un output:
hello
world
Utilizzare:
echo hello
echo.
echo world
Ecco, create un file .bat con il seguente contenuto:
@echo off
REM Creating a Newline variable (the two blank lines are required!)
set NLM=^
set NL=^^^%NLM%%NLM%^%NLM%%NLM%
REM Example Usage:
echo There should be a newline%NL%inserted here.
echo.
pause
Dovresti vedere un output come il seguente:
There should be a newline
inserted here.
Press any key to continue . . .
Avete bisogno solo del codice tra le dichiarazioni REM, ovviamente.