title: Batch - Search text file for specified string and if found set variable to 1
body: <p>I can't seem to find a answer for this, all the questions seem focused on setting whats found in the text file as the variable. I just want to see if the string I have provided exists anywhere in the text file. (on its own line, not sharing a line with another string)</p>
  
  <p>An example:</p>
  
  <p>%usrname%= fish</p>
  
  <p>%banfile%= is just a text file with NOTHING in it.</p>
  
  <pre><code>for /f "usebackq tokens=*" %%f in ('find /c /i "%usrname%" "%banfile%"') do set banned=1
  </code></pre>
  
  <p>Even with nothing in the text file, it still sets %banned%=1. I want it to set the variable %banned%=1 only if it finds one or more of the string "fish" inside the text file.</p>
  
  <p>I am just beginning to understand the <code>for</code> command, so for most people this is probably going to be very simple. Thanks for any help!</p>