holemania
asked on
Command Prompt - Batch file to move files base on create date
I have a folder that I've been archiving files. This folder is getting large, so I need to archive anything that is more than 2 months old. Is there a bat script that someone has that I can use to move files base on create date from Folder1 to Folder2?
Folder location is as followed:
Folder1:
\\nt-1\data\backup\Archive
Folder2:
\\nt-2\data\backup\Archive OldFiles
So I want a script that can look into the Archive folder and see files that has been created that's more than 2 months old. Move those files to the folder ArchiveOldFiles. Any examples or script someone can provide me? This would be a bat file where I can schedule to run like once a month or something.
Folder location is as followed:
Folder1:
\\nt-1\data\backup\Archive
Folder2:
\\nt-2\data\backup\Archive
So I want a script that can look into the Archive folder and see files that has been created that's more than 2 months old. Move those files to the folder ArchiveOldFiles. Any examples or script someone can provide me? This would be a bat file where I can schedule to run like once a month or something.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it working with Govvy's suggestion. Thanks for the example gerwinjansen. I did similar to what you posted, but got it working before you post. So to be fair, I give Govvy a little bit more points.
ASKER
robocopy \\nt-1\data\backup\archive