Comment pouvez-vous insérer une nouvelle ligne dans la sortie de votre fichier batch ?
Je veux faire quelque chose comme :
echo hello\nworld
Ce qui donnerait :
hello
world
Utilisez :
echo hello
echo.
echo world
Voilà, créez un fichier .bat avec ce qui suit :
@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
Vous devriez voir une sortie comme la suivante :
There should be a newline
inserted here.
Press any key to continue . . .
Vous n'avez besoin que du code entre les instructions REM, évidemment.