Name

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

Synopsis

Compare the contents of two files (or sets of files) byte-by-byte and display the differences between them.

To Open

Command Prompt comp

Usage

comp [file1] [file2] [/n=number] [/c] [/offline] [/d] [/a] [/l]

Description

File Compare (comp.exe) compares two files (or more, using wildcards), and reports whether or not the files are identical. If the files are identical, comp.exe will report Files compare OK. If the files are the same size but have different contents, comp.exe displays the differences, character-by character, by reporting Compare Error at OFFSET n (where n is byte offset—the location of the difference, in characters, from the beginning of the file). If the files are different sizes, comp.exe reports Files are different sizes, and the comparison stops there.

Here are the options for comp.exe:

file1, file2

Specify the filenames of the files to compare. For any files that aren’t in the current directory, you’ll need to include the full path. If file1 includes a wildcard, all matching files are compared to file2. Likewise, if file2 includes a wildcard, each matching file is compared to file1. If one or both of these parameters are omitted, comp.exe will prompt you for the files to be compared.

/n= number

Include the /n option to compare only the first specified number of lines in the files, or omit to compare the entire files. For example, specify /n=5 to check on the first five lines in each file.

/c

Disregard ...

Get Windows XP in a Nutshell, Second Edition 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.