Echo string to .txt file with multiple lines - with Windows Batch file

前端 未结 3 451
南旧
南旧 2020-12-13 08:24

I am attempting to create a Windows Batch File that creates a .txt with mulitple lines. I\'ve tried several solutions to insert a line break in the string but no avail. Ther

3条回答
  •  时光说笑
    2020-12-13 09:01

    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
    

提交回复
热议问题