
Then how do we do this? Well for this we use the ^ symbol. (example.bat is NOT going to contain "message > file1.bat")Įxample.bat will just contain "message".

(This will create "example.bat" in the folder "Program Files")īut what if you want to make a file that outputs a new file? ECHO message > file1.bat > example.bat When typing a path or file name that has a space included in it's name, then remember to use "quotes" ECHO Hello how are you? > "C:\Program Files\example.bat" (This will NOT make a file in the folder "Program Files", and might show an error message)īut then how do we do it? Well it's actually extremely simple. ECHO Hello how are you? > C:\Program Files\example.bat If you want to create a file via the ECHO command, in a specific directory on your computer, you might run into a problem.

(ECHO message) > example.bat (same as above, just another way to write it) > example.bat (creates an empty file called "example.bat")ĮCHO message > example.bat (creates example.bat containing "message")ĮCHO message > example.bat (adds "message" to a new line in example.bat) Ways to create a file with the echo command: ECHO.
