Solved

Move files based on modified date

Posted on 2016-11-09
3
24 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:MRGCD-IS
  • 2
3 Comments
 
LVL 4

Assisted Solution

by:AnthonyHamon
AnthonyHamon earned 100 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 23

Accepted Solution

by:
NVIT earned 400 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 23

Expert Comment

by:NVIT
ID: 41903931
Award split accordingly.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now