COMP.exe – Windows CMD Command

Compare two files (or sets of files). Display items which do not match.

Running COMP with no parameters will result in a prompt for the 2 files and any options

To compare sets of files, use wildcards in pathname1 and pathname2 parameters.

When used with the /A option COMP is similar to the FC command but it displays the individual characters that differ between the files rather than the whole line.

To compare files of different sizes, use /N= to compare only the first lines (a common portion of each file.)

COMP will normally finish with a Compare more files (Y/N) prompt
to suppress this: ECHO n|COMP <options>

Errorlevel

COMP will return an ErrorLevel as follows:

0 Files are identical
1 Files are different
2 Cannot open one of the files or invalid arguments or invalid switch

You may also like...

Leave a Reply

Your email address will not be published.