title: How to use Find statement with 'If/else statement' using CMD
body: <p>I am trying to use <code>find</code> command with <code>if..else</code> statement. What I actually want to do is, search for a specific string in multiple log files. If I find that string I want to append the name of that file with "Passed" else "Failed" into another text file.</p>
  
  <p>I have tried the following but it doesn't work:</p>
  
  <pre><code>if (find /n /i "0 error" "filename.log") (
      echo "Passed" &gt; log.txt
  ) else (
      echo "Failed" &gt; log.txt
  )
  </code></pre>