file compare command
You can use the Windows command fc (standing for file compare) to detect differences between two text files.
If you have three text files like these in a folder:



You can run the fc commands below to
a. show any differences between the two files:
fc "C:\foofolder3\test1.txt" "C:\foofolder3\test2.txt"

. . . and the complete differences will be shown.
b. show when two files are identical
fc "C:\foofolder3\test1.txt" "C:\foofolder3\test2.txt"
. . . notice since these files are the same you get the message, "no differences encountered"
c. a command with /LBn , where n = a number of different lines in the two files after which you want the comparison to cease.
fc /LB1 "C:\foofolder3\test1.txt" "C:\foofolder3\test2.txt"