5

Every time I use the Windows comp command, a message containing:

Compare more files (Y/N) ? 

is shown. Can I avoid it by typing N by default?

thanks

Luis Andrés García
  • 5,852
  • 10
  • 43
  • 57

2 Answers2

11

You can pipe an N in there:

echo N | comp file1.txt file2.txt
001
  • 13,291
  • 5
  • 35
  • 66
4

You could also consider using another, also built-in, command, FC. It can perform binary comparison (you need to specify the /B switch: FC /B file1 file2), which seems closer to what COMP does, although the results are still displayed in a different format.

Anyway, it doesn't prompt you for more files to compare, it just does the job and terminates.

Andriy M
  • 76,112
  • 17
  • 94
  • 154