How can I use a batch file to write to a text file?

后端 未结 7 1743
不知归路
不知归路 2020-12-07 07:58

I need to make a script that can write one line of text to a text file in the same directory as the batch file.

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 08:38

    It's easier to use only one code block, then you only need one redirection.

    (
      echo Line1
      echo Line2
      ...
      echo Last Line
    ) > filename.txt
    

提交回复
热议问题