batch file coding help- creating a logfile
Posted on 2014-04-30
Hello- I have a windows batch file that runs on a server using task scheduler. It copies some files from one server share to another. That part works fine. What I would like to be able to have is a log file in the target destination folder that shows when the batch file ran and updates itself as part of the batch file, putting he most recent event at the top
Something simple, lke a text file log.txt which contains:
04/30/2014 08:00 Copy Complete
04/30/2014 07:45 Copy Complete
04/30/2014 07:30 COPY Complete
Can anyone help with the code I would add in the batch file to create the log file (log.txt) if for some reason it does not exist, and then add the current date, time and 'Copy Complete' message to the top line in the text file?