I have written a nested loop for file compare in batch script.
fc 1.txt 2.txt | findstr "no diff"
IF %ERRORLEVEL% EQU 1 (
fc 3.txt 4.txt | findstr "no diff"
IF %ERRORLEVEL% EQU 1 (
echo 1
goto exit
) ELSE (
echo 2
goto exit )))
Logic to execute is: a. If 1&2 and 3&4 are different - echo 1
b. If 1&2 are different but not 3&4 - echo 2
While this code is working fine if there are no differences ie doesn't enter "if" condition. If I try to do requirement for echo 2, it is actually showing echo 1. Not sure how to correct this.