How can you compare the [FILE1.bin] and [FILE2.bin] and then notify ECHO if file 1 is different from file 2?
I would like to do such a thing!
FILE 1 = FILE 2
if it is equal give command ECHO OK
if it is different give command ECHO ERROR
How can you compare two files Binary and notify?
Moderator: DosItHelp
-
- Posts: 22
- Joined: 23 Oct 2018 17:28
Re: How can you compare two files Binary and notify?
the files I have to compare are in HEX
-
- Posts: 128
- Joined: 23 May 2016 15:39
- Location: Spain
Re: How can you compare two files Binary and notify?
Code: Select all
fc /b path\file1.bin path\file2.bin
if %errorlevel% neq 0 (
echo(files are different
) else (
echo(files are identical
)
Code: Select all
fc /?
Code: Select all
for /f
Re: How can you compare two files Binary and notify?
Similar to elzooilogico's answer, but more efficiently and without extraneous output:
Code: Select all
fc /b file1.bin file2.bin >nul && echo OK || echo ERROR