I try to compare two files byte by byte using fc.exe
with option /b
for a binary compare.
When I run the command from within a command prompt window, the output lists the binary differences.
For example the command:
C:\Work\jan21\script>fc.exe /b C:\abc\2.0\common.c C:\Users\rakeshk\Desktop\download_break\final\common.c >b.txt
results in b.txt
containing:
Comparing files C:\ABC\2.0\common.c and C:\USERS\RAKESHK\DESKTOP\DOWNLOAD_BREAK\FINAL\COMMON.C
00000994: 20 09
00000995: 20 69
00000996: 49 6E
00000997: 4E 74
00000998: 20 0D
00000999: 20 0A
0000099A: 55 20
...
And at end FC printed:
C:\USERS\RAKESHK\DESKTOP\DOWNLOAD_BREAK\FINAL\COMMON.C longer than C:\ABC\2.0\common.c
But when I run in batch file for example this command line
fc.exe /b !FILE1! !FILE2!>c.txt
the file c.txt
contains
Comparing files C:\USERS\RAKESHK\DESKTOP\DOWNLOAD_BREAK\FINAL\COMMON.C longer than C:\ABC\2.0\common.c
FC: no differences encountered
Why is FC printing that there are no differences encountered although the files have different contents?