title: How to handle carriage return with windows batch script?
body: <p>I want to use bat to automate some of my work. It should first look up the value of a certain registry key, and then copy some files to the directory that included in the registry key value. 
  I used <strong>reg query</strong> command to look up registry, such as:</p>
  
  <pre><code>REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE
  </code></pre>
  
  <p>The result seems contains carriage return and I need to remove it, I've tried some solutions but all failed. Could anyone help me?</p>