How do you strip quotes out of an ECHO'ed string in a Windows batch file?

后端 未结 12 1885
萌比男神i
萌比男神i 2020-12-05 04:23

I have a Windows batch file I\'m creating, but I have to ECHO a large complex string, so I\'m having to put double quotes on either end. The problem is that the quotes are

12条回答
  •  清歌不尽
    2020-12-05 05:10

    I know that it is not actually for the author, but if you need to send some text to the file without quotes - the solution below works for me. You do not need to use quotes in the echo command, just surround the complete command with brackets.

    (
        echo first very long line
        echo second very long line with %lots% %of% %values%
    ) >"%filename%"
    

提交回复
热议问题