Solved Selective Copy and Delete Batch file

October 14, 2011 at 03:03:10
Specs: Windows 7, XeonQuad3.2GHz / 8GB
I have a folder in which new files are created each day. These files are kept for 60 days and then deleted.
There is also a file created in the same folder on a monthly basis. This is much larger in size than the files that are created each day.

I want to create a batch file that will allow me to copy the daily created files to an external drive, and that will also delete any files on the external drive that are older than 60 days.
I need an exception by filesize within the batch file to prevent the monthly file from being copied to the external drive.

I hope this makes sense.

Thank in advance.

See More: Selective Copy and Delete Batch file

Report •

October 16, 2011 at 00:52:41
✔ Best Answer
For copying files created today

xcopy /y "C:\SourceFolder\*.*" "c:\destinationFolder\*.*" /d:%DATE%

For deleteing files older than 60 Days.

ROBOCOPY C:\source C:\destination /move /minage:60 del C:\destination /q


Report •
Related Solutions

Ask Question