Tutorial by Examples

Format: [command] [> | >>] [filename] > saves the output of [command] into [filename]. >> appends the output of [command] into [filename]. Examples: echo Hello World > myfile.txt saves "Hello World" into myfile.txt echo your name is %name% >> myfi...
Ways to create a file with the echo command: ECHO. > example.bat (creates an empty file called "example.bat") ECHO message > example.bat (creates example.bat containing "message") ECHO message >> example.bat (adds "message" to a new line in example.bat)...
Using many ECHO commands to create a batch file: ( echo echo hi, this is the date today echo date /T echo echo created on %DATE% echo pause >nul )>hi.bat The command interpreter treats the whole section in parenthesis as a single command, then saves all the output to hi.bat. ...

Page 1 of 1