批处理文件 - 不带双引号的 echo 语句

The*_*mer 2 batch-file

所以,我不明白这部分:

echo " _________________________________________________________________ "
echo "|                                                                 |"
echo "| The wall in front of you moved upwards and light shined so      |"
echo "|                                                                 |"
echo "| bright, but you could move. You walked towards the light. And   |"
echo "|                                                                 |"
echo "| from here, your adventure will start soon. We welcome you to    |"
echo "|                                                                 |"
echo "| Votre Monde, Franqais...                                        |"
echo "|_________________________________________________________________|"
Run Code Online (Sandbox Code Playgroud)

所以……问题来了。如果我尝试删除双引号 ("),整个批处理文件会崩溃。我需要删除它,因为它破坏了游戏的设计。有没有办法让 echo 允许上面没有双引号的代码?我会很高兴的。谢谢...

Hac*_*koo 5

您需要|通过添加插入符号来转义此特殊字符^|

你的代码可以这样写:

@echo off
echo  __________________________________________________________________ 
echo ^|                                                                 ^|
echo ^| The wall in front of you moved upwards and light shined so      ^|
echo ^|                                                                 ^|
echo ^| bright, but you could move. You walked towards the light. And   ^|
echo ^|                                                                 ^|
echo ^| from here, your adventure will start soon. We welcome you to    ^|
echo ^|                                                                 ^|
echo ^| Votre Monde, Franqais...                                        ^|
echo ^|_________________________________________________________________^|
pause>nul
Run Code Online (Sandbox Code Playgroud)