Jump to content
xisto Community
ninjamunky

Batch Echo Problem

Recommended Posts

I'm trying to make a batch that displays this ASCII text with echo, but it gives me an error. Here is the script I have:

 

@echo off

cls

echo      ___                      ___        ___          ___   

echo    /__/\        ___          /__/\      /  /\        /  /\   

echo    \  \:\      /  /\        \  \:\    /  /:/      /  /::\ 

echo      \  \:\    /  /:/          \  \:\  /__/::\      /  /:/\:\ 

echo  _____\__\:\  /__/::\      _____\__\:\  \__\/\:\    /  /:/~/::\

echo /__/::::::::\ \__\/\:\__  /__/::::::::\    \  \:\  /__/:/ /:/\:\

echo \  \:\~~\~~\/    \  \:\/\ \  \:\~~\~~\/    \__\:\ \  \:\/:/__\/

echo  \  \:\  ~~~      \__\::/  \  \:\  ~~~      /  /:/  \  \::/   

echo  \  \:\          /__/:/    \  \:\        /__/:/    \  \:\   

echo    \  \:\        \__\/      \  \:\        \__\/      \  \:\   

echo    \__\/                    \__\/                    \__\/   

echo  ___          ___          ___          ___               

echo    /__/\        /__/\        /__/\        /__/|          ___ 

echo    |  |::\        \  \:\        \  \:\      |  |:|        /__/| 

echo    |  |:|:\        \  \:\        \  \:\      |  |:|        |  |:| 

echo  __|__|:|\:\  ___  \  \:\  _____\__\:\  __|  |:|        |  |:| 

echo /__/::::| \:\ /__/\  \__\:\ /__/::::::::\ /__/\_|:|____  __|__|:| 

echo \  \:\~~\__\/ \  \:\ /  /:/ \  \:\~~\~~\/ \  \:\/:::::/ /__/::::\ 

echo  \  \:\        \  \:\  /:/  \  \:\  ~~~  \  \::/~~~~    ~\~~\:\

echo  \  \:\        \  \:\/:/    \  \:\        \  \:\          \  \:\

echo    \  \:\        \  \::/      \  \:\        \  \:\          \__\/

echo    \__\/        \__\/        \__\/        \__\/               

pause

exit


I've highlighted the trouble spot in red. Is there any way around this? I would appreciate some help on this :D You can save this to a .bat for yourself and see the error, just run in through cmd so it doesn't exit right away and you'll see the error. My friend said it was the slashes on the one line, but if it's echo, it should be like a comment, just displayed; or at least in my world it would be :D Again, help appreciated.

Share this post


Link to post
Share on other sites

Dear ninjamunky,

 

Some characters are indeed reserved for some special functions.

Like the greater-than sign, the less-than sign and the pipe sign, and others.

Therefore it is my habit to type all these texts into a separate file,

like message1.txt

 

And then, in the batch file, I execute:

type message1.txt

 

This has the very same result as various echo statements.

The special batch characters pose no problem that way.

And furthermore, I find it easier to maintain.

Share this post


Link to post
Share on other sites

The only character that is probaly problematic is the "|" character.

Try using "^|" instead of "|". This will treat it as a character rather than a operator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.