create a log for a batch file

March 27, 2009 at 12:07:32
Specs: Windows XP
i created a batch file.
it goes to different locations on computers, checking file existence and then does some operations like, decrypting, unzipping, splitting etc.
What i actually need is to create a log of all the operations the batch does.
it will be scheduled to run at 30 min from 9am to 9pm, and i need a log to be created on each run.

IT's not a homework project.
Hope you can help,

See More: create a log for a batch file

Report •

March 27, 2009 at 14:14:37
There is no way to trap a log out of the blue running a batch script. You need patiently to walk through your code and add echo commands or redirect the output of tools involved into a log file planned for that purpose.

Report •

March 27, 2009 at 16:26:48
Step 1: Remove @ECHO OFF
Step 2: Run your script like this: YourScript >> YourLog 2>&1

Report •

Related Solutions

Ask Question