1.

Solve : Batch Command Logging?

Answer»

Hello, I'm trying to capture the output of my batch script to a log file for later review. I've found a way to capture the out put but I can't figure out how to get the batch script to then close or exit at the completion of the script.. I'm currently using 2 batch files to capture the log file which I will list below..

TEST.BAT (contains the following COMMAND):
TEST2.BAT > TEST.LOG 2>&1

TEST2.BAT (contains the following commands):
@ECHO ON
dir
copy *.bat c:\testtest
copy *.txt c:\testtest

After test2.bat runs it CREATES a file call TEST.LOG with everything in it but the DOS window STAYS open and I have to Ctrl+C to BREAK it and close/exit.

Thanks again for your help..Hey,
I've just created the 2 bat files that you wrote and copied the commands u put in them
and it did trasfer the results to the log as you said but it didn't leave any windows open after it



Discussion

No Comment Found