|You would just need to use the echo command with output redirection:|
>testfile.bat echo @echo off
>>testfile.bat echo echo Computer name is %%COMPUTERNAME%%.
>>testfile.bat echo echo Copying files...
>>testfile.bat echo copy file1 file2
There's no reason this wouldn't work with thousands of lines, but it may be a pain to do double percent signs and escape characters (^). The double percents make the variable not be expanded until the second script. Escape characters are required before certain special characters, namely <, >, &.