?
Solved

Command Prompt - Batch file to move files base on create date

Posted on 2011-09-23
4
Medium Priority
?
410 Views
Last Modified: 2012-05-12
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\ArchiveOldFiles

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.
0
Comment
Question by:holemania
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
Govvy earned 1200 total points
ID: 36589733
Use robocopy command with /MINAGE flag
0
 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 800 total points
ID: 36589851
robocopy \\nt-1\data\backup\Archive \\nt-2\data\backup\ArchiveOldFiles /minage:60 /move

Open in new window

0
 

Author Comment

by:holemania
ID: 36589973
Thanks guys.  I got it working from Govvy's advice.

robocopy \\nt-1\data\backup\archive \\nt-2\data\backup\ArchiveOldFile /move minage:60
0
 

Author Closing Comment

by:holemania
ID: 36589983
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.
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question