title: Parse Windows Command with Pipe to Variable in Batch File
body: <p>I am trying to create a Windows batch script that will store the outputs of this command in a variable.</p>
  <pre><code>java -XshowSettings:properties 2&gt;&amp;1 | findstr &quot;user.dir&quot;
  </code></pre>
  <p>Output is something like this</p>
  <pre><code>user.dir = C:\Program Files (x86)\Java\jre1.8.0_291\bin
  </code></pre>
  <p>I want the following portion C:\Program Files (x86)\Java\jre1.8.0_291\bin to store in a variable in my script.</p>
  <p>I've tried using for loop but its not performing the findStr command.</p>
  <p>Any assistance would be greatly appreciated.</p>