WayneS (6/14/2009)
Jeff Moden (6/14/2009)
You've added a line of code the OP didn't have in the original problem and that new line is the one responsible for the incorrect operation.
echo %date% %time% > "%temp%\output.txt
You've neglected to use ">>" in that line of code and that's what resets file. 😉
Correct, I reset the file between the runs, to demonstrate the effects of the two different methods. If the OP wants the file reset between runs, then use this line. If not, then get rid of it.
But the point was that with using the "-o" in the first part, the file is reset for every file being processed. Which is the behavior that the OP was trying to get rid of.
Understood. My point is that I wasn't sure if the OP was going for a continuous "forever" log or just wanted a single log with the results of all the individual steps for a single run of the batch. I posted the solution for the latter. It wasn't wrong, it just wasn't what you expected. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.