How do I echo ASCII art that contains special characters in a batch file?

前端 未结 6 2558
再見小時候
再見小時候 2021-02-12 11:45

So.. This is (to me anyway) the most important feature of this program. I need this to work. Please don\'t laugh.. (okay you can laugh) but when my program errors, I want it to

6条回答
  •  轮回少年
    2021-02-12 12:13

    You need to escape special characters (such as |, used for pipe redirection) in order for it to work.

    However, when using echo not all special batch characters need to be escaped, as some as interpreted as text. The ones you still need to escape, and how to escape them, are:

    % = %%

    ^ = ^^

    & = ^&

    < = ^<

    > = ^>

    | = ^|

    And, if delayed expansion is enabled:

    ! = ^^!

提交回复
热议问题