windows comp command in batch script: remove prompts
Asked Answered
S

2

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

Spencerianism answered 22/1, 2013 at 14:28 Comment(0)
I
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.

Isaiah answered 22/1, 2013 at 19:59 Comment(0)
W
11

You can pipe an N in there:

echo N | comp file1.txt file2.txt
Wozniak answered 22/1, 2013 at 14:32 Comment(1)
+1 - It will still show the Compare more files (Y/N)? prompt, but it will also be answered with 'N'.Phosphocreatine
I
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.

Isaiah answered 22/1, 2013 at 19:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.