Echo string to .txt file with multiple lines - with Windows Batch file
(
echo Here is my first line
echo Here is my second line
echo Here is my third line
)>"myNewTextFile.txt"
pause
Just repeat the echo
and >>
for lines after the first. >>
means that it should append to a file instead of creating a new file (or overwriting an existing file):
echo Here is my first line > myNewTextFile.txt
echo Here is my second line >> myNewTextFile.txt
echo Here is my third line >> myNewTextFile.txt
pause