Name

File Compare (fc) — \windows\system32\fc.exe

Synopsis

C ompare the contents two files (or sets of files) line by line and display the differences between them.

To Open

Command Prompt fc

Usage

fc file1 file2 [/a] [/c] [/lbn] [/n] [/t] [/w] [/offline] [/nnn] 
    [/l]
    [/l]
fc /b filename1 filename2

Description

File Compare (fc.exe) compares the contents of two files (or more, using wildcards) and displays the differences (if any). If the files are identical, fc.exe will report FC: no differences encountered. If the files are different, fc.exe lists the differing lines. Here’s an example of how fc.exe is used:

Start with an ordinary text file, say, Bill.txt. Open it in Notepad, change one line, and save it into a new filename, say, Marty.txt. Then open a command prompt window, make sure you’re in the same directory as the two files, and type the following:

fc bill.txt marty.txt

The output will look something like this:

Comparing files Bill.txt and Marty.txt
***** Bill.txt
Way down Louisiana close to New Orleans
Way back up in the woods among the evergreens
There stood a log cabin made of earth and wood
***** Marty.txt
Way down Louisiana close to New Orleans
Way back up in the woods among the antihistamines
There stood a log cabin made of earth and wood
*****

For each line or sequence of lines that is found to differ in the two files, fc.exe prints out a pair of excerpts from each of the files. The first and last line in each excerpt are what the two files have in common and are included ...

Get Windows XP in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.