title: How can I compare two files in a batch file?
body: <p>How can I compare two files in a batch file, and perform an action based on whether or not they match? I've tried something like:</p>
  
  <pre><code>if file1.txt NEQ file2.txt goto label
  </code></pre>
  
  <p>but it compares the actual string "file1.txt" rather than the file. I've read about the COMP command, but it doesn't seem to work if I put it in an if statement. Does anybody know how to do this? Sorry, but I rarely use batch files and have little experience in them.</p>
  
  <p>Thanks in advance.</p>