title: Using findstr in if in batch-file
body: <p>I tried last week to figure out how an if works in a batch file and no that it should work it just doesn't. I have no idea what's wrong or how to solve the problem since I may have made an error with the if or that I'm missing out on something important.</p>
  
  <pre><code>findstr /C:"Firefox" C:\TestIffile.txt
  pause
  IF (findstr /C:"Firefox" C:\TestIffile.txt) (
  ECHO Firefox &gt; C:\TestIffileResult.txt
  ) ELSE (
  ECHO no Firfox
  )
  </code></pre>
  
  <p>The first findstr works fine and gives me this result. <code>DisplayName    REG_SZ    Mozilla Firefox 58.0.2 (x64 en-GB)</code> which is perfectly fine. The second findstr gives me something like "Firefox was unintended". I've been told that the if would handle the findstr command with a true or false signal but if so why won't it work properly? Thank you in advance.</p>
  
  <p>Btw it's not to find the exe of the program but to save a lot of work by filtering out unwanted lines in my datafiles.</p>