In this post, Learn how to add a new line to the text displayed with the echo command in a batch file.
For example
Want to print the text in multiple lines
line1
line1
There are multiple ways to break lines in echo text.
You can use echo:
to insert the new blank line in the command line output.
multiplelines.bat
@echo off
echo one
echo:
echo two
On running multiplelines.bat
in the command line,
Output is shown as
one
two
Similarly, replace the above with a single syntax using the &
operator.
@echo off & echo one & echo:& echo two
Other alternatives to echo: are below
echo(
echo+
echo,
echo;
echo+
How to echo a multi-line and write to a text file?
using the >
symbol outputs to filename
@echo off & echo one & echo:& echo two > multlines.txt