Wednesday, July 18, 2007

Using WINDIFF to compare 2 directories

Have you ever copied the contents of a folder and the operation erred out midway because of a permission conflict or corrupt file? How do you determine which files are in the new location, so you can restart the copy operation? File-by-file comparison can be difficult if you're dealing with a large number of files.

The DIFF command has been around for a while in the Unix world, and does just what we want. It compares two directories (or files) and reports the differences between them. With WINDIFF, this functionality is available for Windows.

Syntax: C:\>windiff path1 path2

Example:

C:>windiff \wwwroot\GLOBAL\img \Backup\global\img

Generates this:
.\thumbs.db identical
.\vsd.gif identical
.\vssver.scc identical
.\windows.gif only in \wwwroot\GLOBAL\img
.\xls.gif only in \wwwroot\GLOBAL\img
.\zip.gif only in \wwwroot\GLOBAL\img


If you don't have WINDIFF, it is available as part of the WinXP SP2 Support Tools suite (http://www.microsoft.com/downloads/details.aspx?familyid=49ae8576-9bb9-4126-9761-ba8011fabf38&displaylang=en).

No comments: