Compares two files and displays the differences between them.
fc [/a] [/b] [/c] [/l] [/lbn] [/n] [/t] [/u] [/w] [/nnnn] [drive1:][path1]filename1 [drive2:][path2]filename2
/a : Abbreviates the output of an ASCII comparison. Instead of displaying all of the lines that are different, fc displays only the first and last line for each set of differences.
/b : Compares the files in binary mode. Fc compares the two files byte by byte and does not attempt to resynchronize the files after finding a mismatch. This is the default mode for comparing files that have the following file extensions: .exe, .com, .sys, .obj, .lib, or .bin.
/c : Ignores the case of letters.
/l : Compares the files in ASCII mode. Fc compares the two files line by line and attempts to resynchronize the files after finding a mismatch. This is the default mode for comparing files, except files with the following file extensions: .exe, .com, .sys, .obj, .lib, or .bin.
/lbn : Sets the n number of lines for the internal line buffer. The default length of the line buffer is 100 lines. If the files that you are comparing have more than this number of consecutive differing lines, fc cancels the comparison.
/n : Displays the line numbers during an ASCII comparison.
/t : Prevents fc from converting tabs to spaces. The default behavior is to treat tabs as spaces, with stops at each eighth character position.
/u : Compares files as Unicode text files.
/w : Compresses white space (that is, tabs and spaces) during the comparison. If a line contains many consecutive spaces or tabs, /w treats these characters as a single space. When used with the /w command-line option, fc ignores (and does not compare) white space at the beginning and end of a line.
/nnnn : Specifies the number of consecutive lines that must match before fc considers the files to be resynchronized. If the number of matching lines in the files is less than nnnn, fc displays the matching lines as differences. The default value is 2.
[drive1:][path1]filename1 : Specifies the location and name of the first file you want to compare. Filename1 is required.
[drive2:][path2]filename2 : Specifies the location and name of the second file you want to compare. Filename2 is required.
/? : Displays help at the command prompt.
To make an ASCII comparison of two text files that are named Monthly.rpt and Sales.rpt and display the results in abbreviated format, type:
fc /a monthly.rpt sales.rpt
To make a binary comparison of two batch files named Profits.bat and Earnings.bat, type:
fc /b profits.bat earnings.bat
The results similar to the following appear:
00000002: 72 43 00000004: 65 3A 0000000E: 56 92 00000012: 6D 5C 00000013: 0D 7C 00000014: 0D 0A 00000015: 0A 0D 0000001E: 43 7A 0000001F: 09 0A 00000022: 72 44 ... ... ... 000005E0: 00 61 000005E1: 00 73 000005E2: 00 73 000005E3: 00 69 000005E4: 00 67 000005E5: 00 6E 000005E6: 00 6D 000005E7: 00 65 000005E8: 00 6E FC: Earnings.bat longer than Profits.bat
If the Profits.bat and Earnings.bat files are identical, fc displays the following message:
FC: no differences encountered
To compare every .bat file in the current directory with the file New.bat, type:
fc *.bat new.bat
To compare the file New.bat on drive C with the file New.bat on drive D, type:
fc c:new.bat d:*.bat
To compare each batch file in the root directory on drive C to the file with the same name in the root directory on drive D, type:
fc c:*.bat d:*.bat