I first described the FC.EXE command at tip 0305 » Windows NT 4.0 has two built in File comparison commands.
Using the built-in FC.EXE, I have scripted AnyDiff.bat to determine if there is any difference between two specified files.
The syntax for using AnyDiff.bat is:
Call AnyDiff File1 File2 YorN
Where:
File1 is the path to the first file. File2 is the path to the second file. YorN is a call directed environment variable that will contain a Y if there any difference between the two files, or an N if there is no difference.AnyDiff.bat contains:
@echo off if \{%3\}==\{\} @echo Syntax: AnyDiff File1 File2 YorN&goto :EOF if not exist %1 @echo AnyDiff %1 %2 %3 - %1 NOT found.&goto :EOF if not exist %2 @echo AnyDiff %1 %2 %3 - %2 NOT found.&goto :EOF fc /b %1 %2|find /i "no differences">nul if errorlevel 1 (set %3=Y) ELSE (set %3=N)
0 comments
Hide comments