FC command | File comparison using Windows CMD

FC command compares the contents of text or binary files and can compare both Unicode and ASCII text.

Syntax:

FC [pathname1] [pathname2]

Or

FC /B [pathname1] [pathname2]

Usage 1: 

Suppose two files file1.txt and file2.txt are on Desktop (in the same folder/directory), then Open Command prompt-> change the directory to Desktop and use the FC command as shown below.

File-comparison-FC-command-CMD-identical-files-1

If the two files are identical, then it displays “FC: no differences encountered”

File-comparison-FC-command-CMD-identical-files-2

<- Response if one of the files doesn’t exist or file name is wrong

FC_CMD-files-are-not-idenical-response

 

<- Response if the files are different

 

FC-command-binary-file-comparison-CMD

 

<- Response if the files are different and if you perform binary comparison

FC /B

Usage 2:

You can use FC command anywhere in command prompt to compare files by providing full path of the files (see below pic). If the files are in different folders, then also you have to provide full path for files in order to perform comparison using FC.

file-comparison-in-windows-CMD