Use the diff command with the -q switch for simple output, such as:
diff -q folder1 folder2 | sort > compare.txt

Technical notes, and other ideas.
Use the diff command with the -q switch for simple output, such as:
diff -q folder1 folder2 | sort > compare.txt