questions on logging a bat file

Diy / P5q deluxe
February 20, 2009 at 12:32:59
Specs: Windows XP, 3.8GHz / 3326 MB
Here is the scenario, and I've got two questions:

1. I've got a bat file, which continuously running on the background, and I would like to log that bat file to a text file.
I've got a code:

start cmd /k my_bat.bat > ./log_bat/log.txt

to log the output in my_bat.bat and write the output into a text file called log.txt

How can I add the current date and time in front of each new line?

2. The text file will get bigger and bigger in quite a quick manna, in one and half hour time it gets to 500kb already. Is there a way to set a file size limit, say 5mb, then if it exceed the size, rename it as another file name and continue logging?

Thank you very much


See More: questions on logging a bat file

Report •


#1
February 20, 2009 at 17:45:51
1. You can't without some third party utility.

2. You can't without some third party utility.


Report •

#2
February 21, 2009 at 07:39:41
so... any suggestions on third party software that can do this kind of job?

Thankss


Report •

#3
February 21, 2009 at 09:46:41
My approach would be to modify the bat.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

Related Solutions


Ask Question