Windows: in batch file, write multiple lines to text file?

Use output redirection > and >>

echo one>%file%
echo two>>%file%
echo three>>%file%

Or in a more readable way: (In cmd.exe, using “echo one >%file%” would include the whitespace before >.)

>%file%  echo one
>>%file% echo two
>>%file% echo three

You could also use:

(
    echo one
    echo two
    echo three
) >%file%

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)