How to handle carriage return with windows batch script?

Posted by eric2323223 on Stack Overflow See other posts from Stack Overflow or by eric2323223
Published on 2010-04-23T08:40:55Z Indexed on 2010/04/23 8:43 UTC
Read the original article Hit count: 179

Filed under:
|
|
|

Hi,

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 reg query command to look up registry, such as:

REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE

The result seems contains carriage return and I need to remove it, I've tried some solutions but all failed. Could anyone help me?

© Stack Overflow or respective owner

Related posts about batch

Related posts about Windows