Computer Hope
Microsoft => Microsoft DOS => Topic started by: belka on October 22, 2009, 12:37:55 AM
-
Hi guys,
I have a little batch file created which runs fine as attended.
But after adding just a simple ASCII art (as introduction) it's failing. It's just started up for a tiny second and is closed again immediately?!
This I added:
echo _
echo _( )_
echo (_(%)_)
echo (_)\
echo | __
echo |/_/
echo |
echo |
... and nothing else. :-/
Is there anybody being able to help out?
Thank you!
-
echo _
echo _( )_
echo (_(%)_)
echo (_)\
echo | __ <------
echo |/_/ <------
echo | <------
echo | <------
You are using the 'pipe' so the Command Interpreter expects a valid command after it but finds __ instead. This is invalid so the script fails the first time the 'pipe' is used. To correct this Escape the pipes.
& Welcome to the CH forums..
-
You are using the 'pipe' so the Command Interpreter expects a valid command after it but finds __ instead. This is invalid so the script fails the first time the 'pipe' is used.
Aah, and I've already been afraid of that stuff.
To correct this Escape the pipes.
I had to prefix them with carets?! I did that for all pipes but failed again.
What are all relevant special characters and symbols in this regard?
& Welcome to the CH forums..
Thanks. :-)
Thank you.
-
I Escaped the pipes using the caret and the script ran without problem.
echo ^|__
echo ^|/_/
echo ^|
echo ^|
-
... I failed. But after prefixing also '<', '>' and '_' it ran! :-)
Maybe there is a whole bunch of special characters needing a such special treating?!
Thanks so far!
-
There's a list here (http://ss64.com/nt/syntax-esc.html)..
-
There's a list here (http://ss64.com/nt/syntax-esc.html)..
Thank you!
Quoting from there:
When piping or redirecting any of these charcters you should
prefix with the escape character: \ & | > < ^
e.g. ^\ ^& ^| ^> ^< ^^
end of quoting
As you can see this shouldn't be a _complete_ list because I had to prefix ' _ ' in my batch, too?!
-
No. the underscore has no special meaning to the command interpreter and therefore does not require escapement.
-
No. the underscore has no special meaning to the command interpreter and therefore does not require escapement.
Well, that may be or not. In fact I had to prefix even all underline characters (not 'underscore') in order to get my batch running. But maybe there is a 'hidden truth'?
That's why here again what I did for another example:
echo ^_^_ ^_^_
echo .' `...' `.
echo ^_^_^| ^| ^|^_^_
echo .' \ . / `.
echo ^| ./###\. ^|
echo ^>---- ^|#####^| ----^<
echo ^| `\###/' ^|
echo `.^_^_ / . \ ^_^_.'
echo /^| ^| ^|
echo / `.^_^_^_.^.^_^_^_.'
echo ^|
echo ^|
echo \
echo \ )\
echo `. /' ^|
echo \ /' )
echo \ /' /'
echo \ /' /'
echo \( /'
echo ) /'
echo ^| /'
echo ^|(
echo ^|^|
Thank you.
-
Belka - your script works perfectly without the underline (underscore) characters being escaped.
Try this, works for me, tested on Win2k, Win2k.Pro, Win XP.HE and Win XP Pro.
@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 ^|(
echo ^|^|
-
Although when you do escape them, it has a bunch of anime smiley's... ;D
-
Belka - your script works perfectly without the underline (underscore) characters being escaped.
I admit you're right. I checked it renewed. Ago I got a failing, no idea what happened.
Okay, in this way we both learned something new.
Thank you for reliable supporting.