• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

Comparing files and directories after a file copy

I am currently using batch files to back up and restore data to our systems during rollouts and migrations. Source and destination OS is Windows XP Pro.

I need to find a way to check the source and destination to make sure they match afterwards to be sure all files are copied. I've seen issues where the hard drive is failing and it didn't copy all of the data and i didn't realize it because the batch file started copying the next set of data (like "favorites").

I've tried windiff, fc, and so on but nothing that is automated enough just to show a results screen if they are different sizes. Example: the local mydocs folder has 5000 files totaling 3.5GB and the server has only 4000 files totaling 2.3GB... i want to see the files and folders in a summary that were NOT copied.

Any ideas on this? BTW: i've gone through the XP and VB sections and have not been able to find a solution that matches what I need.

1 Solution
I would highly recommend your using robocopy for this...

It will copy source to target and then update it at any point thereafter with any file(s) that have been changed or were not copied in the process.

Better still, it includes a retry parameter to allow you to specify the number of attempts to make before giving up (if any)...
Robo copy is most likely the thing you are looking for to solve your over all problem but for the compare with reports part of your question I _highly_ recomment Beyond COmpare from:


I've been using BC for years now and hands down it is the best comparitor I've used.   I use it primarily for GUI comparisons but it has a command line interface for generating reports and you can specify how you want the files compare: full binary, size, date, crc, etc with any combination there of.

Rob WilliamsCommented:
If looking for a utility to compare after the fact, you can use 2XExplorer. It will allow you to mirror two windows displaying the same folders in each file structure. As you browse through one set of folders, the other widow will display the same, matching folder structure, at the same time, in the other window. Differences, or missing files are highlighted, and it's free.
Ron MalmsteadInformation Services ManagerCommented:
Did you use the /D switch....so that it will only copy modified or new files ?
xcopy "\\server1\share\*.*" "\\server2\share\*.*" /D /E /I /H /Y /Z
This will copy all files, including hidden and system, all directories including empty ones, overwriting if the file that exists is older than the one your copying, without prompting, and copies all files in restartable mode in case of network error.

If you run this xcopy command with the /D switch...it is automatically comparing the two directories, as well as subdirectories, and files, by "DATE".  When the command is finished...if you run it again...in a short amount of time it should say 0 files copied, because no changes have occurred.  Pretty much syncronizing two directories.

good luck.
ViperZ2000Author Commented:
Just to be clear, this is being done is mass migrations where we may have 250 computers per day over a 10 day period.

xuserx2000 - i like this option but will need to test it out to see how much time it adds.

keep the suggestions coming!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now