The first thing that sprang to my mind was to sort the files, but that answer has already been suggested (twice). As an alternative, if the content is the same, then they will have the same checksum, so an MD5 checksum generator, such as the Microsoft File Checksum Integrity Verifier would be an alternative.
The Microsoft File Checksum Integrity Verifier tool is an unsupported
command line utility that computes MD5 or SHA1 cryptographic hashes
for files.
The only way for two files to generate the same MD5 or SHA1 is for their content to be identical (btw, I think that everyone here is assuming that whitespace is significant - is that correct?).
The beauty of this is that you can do it from the command line, without having to:
- open both files in an editor
- sort their contents
- compare the files
- abandon both edits (and hope that you never save by mistake)
Being command line based, you ought to be able to incorporate it into a batch file, if needed.