title: Multiple commands cmd in a single line of for /f
body: <p>I have run this command each line in cmd and works fine. How to run this command in cmd in one line?</p>
  
  <p>I have try use <code>&amp;</code> but i get different result if i run command line by line and use <code>&amp;</code>.</p>
  
  <pre><code>for /f %i in ('getmac^|find "-"') do set str=%i
  set string=%str:-=%
  REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318} /s | findstr "\&lt;%string%\&gt;"
  </code></pre>
  
  <p>Below I attach a printscreen</p>
  
  <p><a href="https://i.stack.imgur.com/JMu3B.jpg" rel="nofollow noreferrer">Command run line by line</a></p>
  
  <p><a href="https://i.stack.imgur.com/sr16y.jpg" rel="nofollow noreferrer">Command run with <code>&amp;</code></a></p>