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
Asked
Active
Viewed 113 times
0

hackedshadow
- 15
- 5
-
How about using an editor ? – stacker Oct 05 '20 at 14:58
-
I would like it so that when i run the Bat file it automatically makes the file with the specified code – hackedshadow Oct 05 '20 at 14:59
1 Answers
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
-
2Well, this also adds the quotation marks and the trailing space to the file… – aschipfl Oct 05 '20 at 15:03
-
-
"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