I'm working on writing a pretty simple Windows batch file. The batch needs to call another batch, which we'll call batch2 (batch2 will be dynamically generated by a separate process). I want to log all of the activity from batch2, but not just the output from the commands it runs.
Here's what I have so far:
main batch
batch2
The output from each command in batch2 is normally "Command completed successfully." The problem is, all I end up with in the log file is this:
What I really need in the log is this:
Any idea what I need to tweak to get this? It would be preferable to handle all of the logging commands from within the main batch file, instead of inside batch2. Thanks!
Here's what I have so far:
main batch
Code:
call batch2.bat >> batch2log.log
batch2
Code:
command-1
command-2
command-3
The output from each command in batch2 is normally "Command completed successfully." The problem is, all I end up with in the log file is this:
Code:
Command completed successfully.
Command completed successfully.
Command completed successfully.
What I really need in the log is this:
Code:
command-1
Command completed successfully.
command-2
Command completed successfully.
command-3
Command completed successfully.
Any idea what I need to tweak to get this? It would be preferable to handle all of the logging commands from within the main batch file, instead of inside batch2. Thanks!