I'm assuming you are really using Windows, and not MS-DOS.
I'm also assuming all the .log
files are in the same folder.
No batch file is required. Simply CD
to the folder with the log files. Then run the following command:
type *.log >combinedLog.txt 2>&1
The TYPE command will include the file name at the top of each file output when a single command types multiple files. The file name is printed to stderr, so stderr is redirected to stdout (2>&1
).