Create a Log of a Batch File
Posted on 2011-10-25
I have a batch file that I copied from another site and modified it for the folders I wanted to copy data from and to. I need some help with the code to put in that will create a log file each day that it runs and have that log file named for the current days date when it runs YYYYMMDD.log. So if it ran today a log would be created called 20111025.log, tomorrow would be 20111026.log for example. Below is my current code. It copys the files with the date modified as the current day and pastes it into another folder. Thanks for any help.
::Copy Files Made Or Modified Today
for /f %%a in ('dir /b /a-d /o-d') do call :PROCESS "%%a"
for /f %%j in ('echo %~t1') do set d=%%j
if "%d%"=="%t%" copy %1 "%dest%"