0

I know how to make a batch file make a file using echo. 2>EmptyFile.txt But how would I add information to the file? thanks

1 Answers1

0
echo cmd1 > file  
echo cmd2 >> file    

Where cmd1 or cmd2 need to be replaced by the required statements you want to have in the batch file. ( >> appends)

stacker
  • 68,052
  • 28
  • 140
  • 210
  • 2
    Well, this also adds the quotation marks and the trailing space to the file… – aschipfl Oct 05 '20 at 15:03
  • so just remove the quotations, it will still echo – hackedshadow Oct 05 '20 at 15:06
  • "cmd1" and "cmd2" is meant as placeholder for whatever command is required. – stacker Oct 05 '20 at 15:09
  • @stacker, I think you just mean the string of data you want output to the file. The commands will not execute with the `ECHO` command at the beginning. – Squashman Oct 05 '20 at 15:14
  • I know it is really easy to give an answer to a question, but in my humble opinion it would have been just as easy to find a previous question that answered the users question. – Squashman Oct 05 '20 at 15:16