Thread: Move Files to an Archive Folder
07-10-12, 10:22 #1Registered User
- Join Date
- Jun 2012
Unanswered: Move Files to an Archive Folder
could you help me on this please..
i need a code that moves the files in one folder to another folder(archive) depending on the date stamp on their filenames.
here are some sample filenames of my files(CSVFile_YYYYMM.csv):
i only need to retain the files that are in the past 2 months(CSVFile_201206.csv and CSVFile_201206.csv). Then the earlier months should be moved to the archived folder.
this code will be scheduled to run every monday. it will compare the "YYYYMM" of the files to the system date.
so for example if it will run today,
if CSVFile_YYYYMM.csv < ("201207") - 2
then move CSVFile_YYYYMM.csv to archive folder
else do not move
that would roughly be the condition.
I need your help guys! thank you very much!