3

So, I don't get it about this part:

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 "|_________________________________________________________________|"

So... here's the problem. If I try to remove the double quotes ("), the whole batch file crashes. I need it to be remove because it ruins the design of a game. Is there a way to let an echo allowed the code above without double quotes? I'd be very glad. Thank you...

plasmaTonic
  • 345
  • 2
  • 7
  • 22
The_Gamer
  • 43
  • 1
  • 8
  • Please read the error description. `echo | |` will produce `| was unexpected at this time.` which gives you a hint and you can [search for that](https://www.google.com/search?q=pipe+cmd+was+unexpected+at+this+time&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&dcr=0&ei=c3ciWtCTG4SrrAGdjJLACw) – phuclv Dec 02 '17 at 09:51
  • 1
    [how to escape pipe symbol | in bat scripts?](https://superuser.com/q/270004/241386). anyway it's better to use powershell nowadays – phuclv Dec 02 '17 at 09:54
  • 3
    Possible duplicate of [Batch character escaping](https://stackoverflow.com/questions/6828751/batch-character-escaping) – phuclv Dec 02 '17 at 09:59

1 Answers1

8

You need to escape this special character | by adding a caret ^|

and your code can be written like this one :

@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
Hackoo
  • 18,337
  • 3
  • 40
  • 70
  • @The_Gamer Did you tried as batch file and did you got some problems in your design ? i don't know since i have no idea about your whole code ? – Hackoo Dec 02 '17 at 09:55