title: Storing the return of a line from FINDSTR into a variable, it sets it two times
body: <p>I am trying to write a script that will check another batch script setup for a tool I am running.</p>
  
  <p>Inside the batch file to be checked is the line:
  set tooldir=D:\Folder</p>
  
  <p>I want to be able to pull 'D:\Folder' out and check its validity, but I cannot even get my variable to store the right string. </p>
  
  <p>As of now I have:</p>
  
  <pre><code>for /F "delims=" %%a in ('findstr /L tooldir= %batFileName%') do set batToolDir=%%a
  echo %batToolDir%
  </code></pre>
  
  <p>Which outputs</p>
  
  <pre><code>C:\Users\me&gt;for /F "delims=" %a in ('findstr /L tooldir toolBatch.bat') do set batToolDir=%a
  C:\Users\me&gt;set batToolDir=set tooldir=D:\Folder
  C:\Users\me&gt;set batToolDir=cd %tooldir%
  C:\Users\me&gt;echo cd %tooldir%
  cd %tooldir%
  </code></pre>
  
  <p>It is setting my output variable twice, the first time is correct and then for some reason it does set batToolDir=cd %tooldir%</p>