Friday 8 December 2017

Copy all files created after a specific hour in command line (Windows)?


I would like to easily copy a batch of files from one very big directory to another based on the hour of creation (every hour i want to copy the files from last hour).


I have used Xcopy /D function but you can only put the date but not the hour.


Is there another command? the directory is really big and it's very long to test each file for it's creation date in a Script. Xcopy is great but lacks the hour.



Answer



Robocopy will do the job, assuming you can specify a file from the previous hour's copy as a timestamp -- something like


robocopy   * /XO  

should do the trick, with a bit of tweaking. Hope this helps!


Edited to add: On a pre-Vista box you may need to download Robocopy, which as far as I know is best obtained in the Server 2003 Resource Kit Tools download; as far as I'm aware, Vista and newer should have Robocopy installed by default and present in your path.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...