Using WinMerge to Delete Duplicate Files
A previous post, entitled More Compare-Tool Tips, inspired this question (paraphrasing): “Can WinMerge be used to identify and eliminate duplicate copies of files (across a LAN)?” Absolutely, yes it can. Here are the step-by-step instructions:
Say that we have a file folder, C:\project_one, which contains three subfolders (raw_material, analysis, publications), and that they in turn contain hundreds of Notepad files (*.txt), Microsoft Word documents (*.doc), and spreadsheet files (*.xls). At one point, the entire project_one folder was copied to a file server on the LAN (E:\user\smith\project_one). Work commenced in both places, and now we need to reconcile them.
Deleting Duplicates:
- Start WinMerge
- File | Open
(click to enlarge) - Specify one copy of the project folder as being the “left” folder, and the other as the “right”. It doesn’t matter which is which. (Note: WinMerge automatically and constantly checks the validity of whatever you enter for left and right, disabling the OK button until both are valid.)
- WinMerge has two folder compare modes: it can automatically drill down through all subfolders to present one large list of all files found, or it can present one folder at a time, leaving it up to the user to manually drill down into subfolders of interest. To get the combined list, check the box labeled “Include Subfolders”; otherwise, leave it unchecked.
- Click OK. You’ll see results like this, for automatic drill down:
(click to enlarge)
or like this, for manual drill down:
(click to enlarge) - WinMerge has options to filter the display of comparison results in various ways. The options are under the view menu and they are self-explanatory. In this case, we are looking for identical files that we can safely delete, so we will turn off all options except for show identical files, and show binary files.

The Comparison Result column should now contain only entries that say “Identical” or “Binary files are identical”. - To delete an individual file, right-click on the file and select Delete | Right (or Delete | Left), as desired.
- To delete multiple files at once, use shift-click (to select a range), ctrl-click (to pick and choose), and/or Ctrl+A (to select all) until all of the files to be deleted are highlighted, and then right-click and select Delete | Right (or Delete | Left), as desired.

Other Functions:
As you can see, the context menu offers plenty of other functions for manipulating the files: Copy, Move, Rename, Open, Zip. Each of those comes in multiple flavors. For example, the copy function not only allows you to copy from left to right, or vice versa, but you can copy either one to yet a third location. So, to reconcile files that were created/edited directly on the file server with the files on the local hard disk, use Copy Right to Left (or vice versa, as appropriate)
Miscellaneous Tips:
- WinMerge automatically remembers any settings you changed the last time around, so always be sure to pull down the View menu and verify that the view filters that you want selected/not selected are correct.
- When a file is this in both places and they are different, the timestamps offer a clue as to which is the better file. For your convenience, WinMerge places an asterisk next to the more recent of the two timestamps.
- When a file is this in both places and they are different, if the files are ASCII, you can double-click on the directory entry to compare them. If the files are binary (e.g. a Microsoft Word document), then, at least, you can right-click and select Open Right | with Registered Application, and Open Left… and then manually compare the two. (Microsoft Word itself has a function for comparing to Word documents, as does newer versions of Microsoft Excel, but that’s beyond the scope of this tip article.)
Read more: Software, Windows, Productivity

mrbho wrote:
thanks for the how-to.
Posted 20 Mar 2007 at 7:09 pm ¶
Humpfle wrote:
hello,
i want to merge a folder (with a lot of subfolder) and delete all identical files.
Your description does not work for subfolders… What can i do to delete all identical files (without folder if there is at least ONE not identical file)?
thx
Posted 11 Jul 2011 at 5:37 am ¶