Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: batch file with ASCII art  (Read 34829 times)

0 Members and 1 Guest are viewing this topic.

belka

    Topic Starter


    Greenhorn

    batch file with ASCII art
    « 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!

    Dusty



      Egghead

    • I could if she would, but she won't so I don't.
    • Thanked: 75
    • Experience: Beginner
    • OS: Windows XP
    Re: batch file with ASCII art
    « Reply #1 on: October 22, 2009, 02:05:04 AM »
    Quote from: belka
    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..
    One good deed is worth more than a year of good intentions.

    belka

      Topic Starter


      Greenhorn

      Re: batch file with ASCII art
      « Reply #2 on: October 22, 2009, 02:43:01 AM »
      Quote
      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. 

      Quote
      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?

      Quote
      & Welcome to the CH forums..

      Thanks.  :-)


      Thank you.
      « Last Edit: October 22, 2009, 03:25:20 AM by belka »

      Dusty



        Egghead

      • I could if she would, but she won't so I don't.
      • Thanked: 75
      • Experience: Beginner
      • OS: Windows XP
      Re: batch file with ASCII art
      « Reply #3 on: October 22, 2009, 03:55:18 AM »
      I Escaped the pipes using the caret and the script ran without problem.

      echo ^|__
      echo ^|/_/
      echo ^|
      echo ^|

      One good deed is worth more than a year of good intentions.

      belka

        Topic Starter


        Greenhorn

        Re: batch file with ASCII art
        « Reply #4 on: October 22, 2009, 04:02:43 AM »

        ... 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!

        Dusty



          Egghead

        • I could if she would, but she won't so I don't.
        • Thanked: 75
        • Experience: Beginner
        • OS: Windows XP
        Re: batch file with ASCII art
        « Reply #5 on: October 23, 2009, 01:18:34 AM »
        There's a list here..

        One good deed is worth more than a year of good intentions.

        belka

          Topic Starter


          Greenhorn

          Re: batch file with ASCII art
          « Reply #6 on: October 23, 2009, 03:29:43 AM »

          There's a list here..

          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?!


          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: batch file with ASCII art
          « Reply #7 on: October 23, 2009, 10:31:29 AM »
          No. the underscore has no special meaning to the command interpreter and therefore does not require escapement.
          I was trying to dereference Null Pointers before it was cool.

          belka

            Topic Starter


            Greenhorn

            Re: batch file with ASCII art
            « Reply #8 on: October 23, 2009, 02:53:04 PM »
            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.

            Dusty



              Egghead

            • I could if she would, but she won't so I don't.
            • Thanked: 75
            • Experience: Beginner
            • OS: Windows XP
            Re: batch file with ASCII art
            « Reply #9 on: October 23, 2009, 03:07:55 PM »
            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.
            Code: [Select]
            @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                   ^|^|
            « Last Edit: October 23, 2009, 03:37:04 PM by Dusty »
            One good deed is worth more than a year of good intentions.

            BC_Programmer


              Mastermind
            • Typing is no substitute for thinking.
            • Thanked: 1140
              • Yes
              • Yes
              • BC-Programming.com
            • Certifications: List
            • Computer: Specs
            • Experience: Beginner
            • OS: Windows 11
            Re: batch file with ASCII art
            « Reply #10 on: October 23, 2009, 11:02:21 PM »
            Although when you do escape them, it has a bunch of anime smiley's...  ;D
            I was trying to dereference Null Pointers before it was cool.

            belka

              Topic Starter


              Greenhorn

              Re: batch file with ASCII art
              « Reply #11 on: October 24, 2009, 04:16:33 AM »
              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.