windows - Batch script which moves ".log" files into a new folder based on date -
batch script move .log files of month new folder
move d:\source\log\*.log* d:\destination\log\backup
here sample move files older n days or dd/mm/yyyy
.
but have check in forfiles /?
if date format regional.
in case it's dd/mm/yyyy
the following batch match every *.log older 30/08/2015
every 30/08/2015, 29/08/2015, 28/08/2015......01/01/1970
matched.
@echo off set "source=d:\interfaces\clarity_transaction_interface\log" set "destination=d:\interfaces\clarity_transaction_interface\log\backup" forfiles /d -30/08/2015 /p "%source%" /m *.log /c "cmd /c echo move @path \"%destination%\"" exit /b
Comments
Post a Comment