Windows doesn’t come with a simple command-line differencing tool as does UNIX/Linux. This is unfortunate because even Windows has to do some scripting from time to time and comparing files manually, correctly, is a pain.  Here is a short list of options that I am aware of for differencing files on a Windows system.

  • MS-DOS Tools
    • fc
    • windiff
  • Windows Power Shell
    • compare-object
  • Win32 versions of UNIX utilities
    • unixutils – diff.exe
  • Third Party Utilities
    • WinMerge GUI

MS-DOS Tools

The file comparison tool, fc.exe comes with Windows and can perform an ASCII or binary file comparison:

fc file1.txt file2.txt

The windiff.exe tool does the same comparison, but within the Windows GUI.  For Windows 2000, 2003 and XP, this tool is in the Support Tools kit, or the Resource Kit for older versions of Windows.  The windiff.exe tool can also compare the list of files in folders.

Windows Power Shell

Windows 7 comes with PowerShell, you have to download it for all other versions. Within the powershell are “command-lets” and one of those is compare-object.  To compare the contents of two files, you have to use this long, complicated setup:

compare-object -referenceobject $(get-content C:\test\testfile1.txt) -differenceobject $(get-content C:\test\

Win32 Versions of UNIX Utilities

There is a bundle called “unixutils” that is a Windows 32-bit port of the standard UNIX utilities. I prefer these so much, I actually make a point of installing it on any workstation I use frequently.

diff file1.txt file2.txt

Third Party Tools

There are also several third party tools, but the one that seems to work best is called WinMerge, which is free and open source.

Screenshot: WinMerge file comparison utility

Screenshot: WinMerge file comparison utility