title: Save output from FIND command to variable
body: <p>Like the title says, I'm trying to take the output from a FIND command and save it to a variable. Specifically, I'm using:</p>
  
  <pre><code>DIR /b /s "C:\" | FIND "someexe.exe"
  </code></pre>
  
  <p>to locate a specific .exe file, which seems to work fine, but then I want to save the results of FIND to use later in the same script.</p>
  
  <p>I've tried various different tweaks of:</p>
  
  <pre><code>for /f "usebackq" %%i in (`DIR /b /s "C:\" | FIND "someexe.exe"`) do SET foobar=%%i
  </code></pre>
  
  <p>but when I try to run the script the command window immediately closes (presumably due to some error, I tried putting a PAUSE command in the next line to no avail).</p>
  
  <p>I assume it's some stupid minor thing that I'm doing wrong but if someone could show me what it is I'd appreciate it. Just for further reference, I don't care how many copies of "someexe.exe" exist, I just need the path for one of them.</p>