?
Solved

Move files based on modified date

Posted on 2016-11-09
3
Medium Priority
?
157 Views
Last Modified: 2016-11-28
We have a user that normally sends an email with a list of files that were created on the same day.  We then go in, and move them from one server to a location the user has access to.  

Is there a way to do this in a batch file so the user can just run it on the day they need the files, and it automatically moves the files from that day?  

Basically want to take myself out as being the middle man, in case I am not available some day.
0
Comment
Question by:Josh Hind
  • 2
3 Comments
 
LVL 4

Assisted Solution

by:AnthonyHamon
AnthonyHamon earned 400 total points (awarded by participants)
ID: 41880977
You can use robocopy as follows:

robocopy D:\source D:\destination /maxage:1

This will copy any file in D:\source modified in the last 24 hours to D:\destination
0
 
LVL 26

Accepted Solution

by:
NVIT earned 1600 total points (awarded by participants)
ID: 41881008
Since you want to move the files, you need the MOVE switch.

robocopy "D:\source folder" "D:\destination folder" "*.*" /maxage:1 /mov

Open in new window


If you'd like full automation, i.e. without the user running it, you can put the line in a scheduled task. This would be useful in case the user forgets to manually run it.
0
 
LVL 26

Expert Comment

by:NVIT
ID: 41903931
Award split accordingly.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

839 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