Batch make file with next line

3549 views batch-file
4

I was wondering how you would make a batch write a file like this but will 2 lines

echo [Autorun]
open=test.bat > F:\autorun.inf

this does not work so what would?

answered question

1 Answer

3

You can use >> to append text to the end of files.

echo [Autorun] >F:\autorun.inf
open=test.bat >>F:\autorun.inf

You could also use parentheses to avoid writing the output file name multiple times.

(
    echo [Autorun]
    echo open=test.bat
) >F:\autorun.inf

posted this

Have an answer?

JD

Please login first before posting an answer.