Ok... here we go again.
You start with your first batch-file (test.bat) and place this in it:
Code:
echo a command > test2.bat
echo another command >> test2.bat
echo another command >> test2.bat
The first line creates test2.bat and places a command in it
The second line places another command in it. The >> prevents the previous line from being overwritten.
The third line does the same.
An example:
code for test.bat:
Code:
echo @echo off > c:\windows\test2.bat
echo cls >> c:\windows\test2.bat
echo dir >> c:\windows\test2.bat
Line 1: create test2.bat in c:\windows and set its echo to off.
Line 2: pipe the cls command to test2.bat
Line 3: pipe the dir command to test2.bat
Now the code for test2.bat will be: