title: How to set output from findstr to a variable
body: <pre><code>@echo off
  set result=""
  setlocal enabledelayedexpansion
  for /f %%i in ('FINDSTR /I /S /C:"A=1" C:\Users\Family\Desktop\saxcz find.bat') 
  do set result=%%i
  )
    echo !result!
  ) else (
    echo xx
  )
  pause&gt;nul
  </code></pre>
  
  <p>is my code but the output is</p>
  
  <p>C:\Users\Family\Desktop\saxcz\find.bat:set
  xx</p>
  
  <p>why is this happening?</p>