title: How to store result of a command in a variable in bat script
body: <pre><code>FOR /F "tokens=1 delims=" %%A in ('netstat -ano | findstr 7001') do SET   myVar=%%A 
  echo %myVar% 
  </code></pre>
  
  <p>Command says that it does not recognize <code>|</code> before <code>findstr</code>, can anyone help me out here.</p>