title: batch regex the output of reg query command to a variable
body: <p><strong>summary</strong></p>
  
  <p>I need to be able to find the DWORD value of a registry key and set a variable to it to run an if statement against it.</p>
  
  <p>how can i grab just the dword of a reg query so that i can work with it in the rest of my script?</p>
  
  <p><strong>reg query</strong></p>
  
  <pre><code>reg query HKLM\System\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile /v EnableFirewall
  </code></pre>
  
  <p><strong>req query output</strong></p>
  
  <pre><code>EnableFirewall    REG_DWORD    0x1
  </code></pre>
  
  <p><strong>what i need to grab</strong></p>
  
  <p><code>0x1</code></p>
  
  <p><strong>pseudo code</strong></p>
  
  <pre><code>query firewall reg value
  regex out DWORD value and set to variable var1
  if var1 == 0x1 then do blah
  else do other blah
  </code></pre>