A Angel Tsankov Mar 14, 2006 #1 I use fc.exe to perform binary comparison between files. How can I know in a batch script if they are different?
I use fc.exe to perform binary comparison between files. How can I know in a batch script if they are different?
F foxidrive Mar 14, 2006 #2 I use fc.exe to perform binary comparison between files. How can I know in a batch script if they are different? Click to expand... Use "find.exe" and test the errorlevel. @echo off fc /b file1 file2|find /i "no differences">nul if errorlevel 1 echo miscompare if not errorlevel 1 echo compared ok
I use fc.exe to perform binary comparison between files. How can I know in a batch script if they are different? Click to expand... Use "find.exe" and test the errorlevel. @echo off fc /b file1 file2|find /i "no differences">nul if errorlevel 1 echo miscompare if not errorlevel 1 echo compared ok
D Dean Wells [MVP] Mar 14, 2006 #3 There are many ways to do this ... here's just another possibility - fc c:\f1.exe c:\f2.exe /b >nul 2>&1 && echo Same|| echo Different Note that the absence of any one of the files can cause a false positive and may need to be handled depending upon your requirements.
There are many ways to do this ... here's just another possibility - fc c:\f1.exe c:\f2.exe /b >nul 2>&1 && echo Same|| echo Different Note that the absence of any one of the files can cause a false positive and may need to be handled depending upon your requirements.