How to compare two directories to see which has newer files?

NleahciM

2[H]4U
Joined
Aug 2, 2002
Messages
3,517
Hi - I'm in the middle of switching over from one hard drive to another. Part of that was moving all my programming work over. This has been a very gradual process for me, so I am a little worried that I could have accidentally done some programming work on the old hard drive.

What I'd like to do is this: have some program parse through all my source code folders and compare last modified dates on all the files. The files should be in identical directories with identical names - it's just that one set should be newer than the other.

Anybody have any idea how to do this?
 
Is this Windows?

If so, copy using the robocopy utility, which allows you to use switches like /XO copying from source to destination. The /XO switch makes robocopy compare files in the source to files in the destination, and if the destination's copy is the same date or newer than the source, it won't copy that file.

Will probably have to download the Windows 2003 Resource kit for Robocopy:
http://www.microsoft.com/downloads/...69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

You might want a GUI frontend to Robocopy if you do not like using the command prompt for this:
http://download.microsoft.com/downl...8546-25c359cc0842/UtilitySpotlight2006_11.exe

And I could not find a good reference for Robocopy on Microsoft's site, so you can just run

Code:
robocopy /?

for help or check this Wikipedia link, which lists the switches for Robocopy.
http://en.wikipedia.org/wiki/Robocopy
 
Back
Top