FC

Index

Compares two files or sets of files and displays the differences between them.

Syntax:

FC [/Switches] file1 file2

Switches:

/BPerforms a binary comparison.
The two files are compared byte by byte and there is no attempt to resynchronize the files after finding a mismatch. This is the default mode for comparing files that have extensions of .EXE, .COM, .SYS, .OBJ, .LIB, or .BIN.
/LCompares files as ASCII.
The two files are compared line by line and FC attempts to resynchronize the files after finding a mismatch. This is the default mode for comparing files that do not have extensions of .EXE, .COM, .SYS, .OBJ, .LIB, or .BIN.
/LBnSets the number of lines for the internal line buffer.
If the files being compared have more than this number of consecutive differing lines, FC cancels the comparison.
Default value of n: 100
/nnThe number of consecutive lines that must match before the files are declared resynchronized. If the number of matching lines in the files is less than this number, the matching lines are displayed as differences.
Default value of nn: 2.
/NDisplays the line numbers on an ASCII comparison.
/AAbbreviates the output of an ASCII comparison. Only the first and last line for each set of differences is displayed as opposed to the default of every different line.
/CDisregards the case of letters.
/TDoes not expand tabs to spaces.
By default, tabs are treated as spaces with 1 tab = 8 spaces.
/WCompresses tabs and multiple spaces to a single space for the comparison.

Notes:

  1. If file1 includes a wildcard, all applicable files are compared to file2.
    If file2 also includes a wildcard, it is compared with the corresponding file1.

  2. If FC can detect no differences between the two files being compared, the result is displayed as:

    
    C:\WINDOWS>fc c:\test1.txt c:\test2.txt
    Comparing files c:\test1.txt and c:\test2.txt
    FC: no differences encountered
    
    C:\WINDOWS>_
     

    If differences are found in ASCII mode, the last line that is the same in both files is displayed, followed by any lines that are different, and concluding with the next line that is the same.

    
    C:\WINDOWS>fc c:\test1.txt c:\test2.txt /n
    Comparing files c:\test1.txt and c:\test2.txt
    ****** c:\test1.txt
         4:  This is test fourth line
         5:  This is test fifth line
    ****** c:\test2.txt
         4:  This is test fourth line
         5:  This is an extra line
         6:  This is test fifth line
    ******
    
    C:\WINDOWS>_
    

    If differences are found in binary mode, no attempt at rematching is made. Instead, once a difference is found, the address is listed followed by the mismatching byte values of the two files:

    
    C:\WINDOWS>fc c:\test1.txt c:\test2.txt /b
    Comparing files c:\test1.txt and c:\test2.txt
    000000B0: 6E 23
    000000B1: 65 6E
    FC: c:\test2.txt longer than c:\test1.txt
    
    C:\WINDOWS>_
     

    Here, the first difference in the files occurred at the B0th (176th) byte from the start of the files - where the first file had a byte value of 6E (n), the second had 23 (#).
    The B1th byte is also different.

File Details

File NameVersionSizeDateDefault Location
Fc.exe Win95: Upgrade20,49411/07/95c:\windows\command
Win95: OSR2.520,57424/08/96c:\windows\command

If you should have any comments or suggestions,
please contact: Bob Watson
.
This page last revised:
December 9, 1999.