user3493606
user3493606

Reputation: 3

Issues when displaying ASCII Art in command prompt

@echo off
:menu

color 0b
ping localhost - n 5 >nul
type C:\Users\Suzettec\Desktop\textgamemenuscreen.txt
ping localhost - n 10 >nul
cls
goto menu2
:menu2
echo OOOOO OOOO OO  OO OOOOO
echo   O   O0     OO     O   C:\Main>Game
echo   O   OOOO OO  OO   O  
echo.
echo.
echo [1] Start
echo [2] Instructions 
echo [3] Exit
set/p type="C:\Main>Game= "
if type == 1 then goto TextGameMAINLEVEL
if type == 2 then goto Inst
if type == 3 then goto Exit
goto menu2                   

This doesn't work.

I want it too show the "type" and then switch to menu2. The TEXT C:\Main>Game ASCII Art don't work. It outputs:

O   O0     OO     O   C:\Main

instead of

O   O0     OO     O   C:\Main>Game

Upvotes: 0

Views: 728

Answers (1)

Sebastian Mach
Sebastian Mach

Reputation: 39109

The line

echo   O   O0     OO     O   C:\Main>Game

is equivalent to

echo   O   O0     OO     O   C:\Main > Game

the relevant part being > Game which directs the output of the preceding command, i.e. the text "O O0 OO O C:\Main" into a textfile named "Game".

You need to escape the > character using ^:

echo   O   O0     OO     O   C:\Main^>Game

Further info: http://www.robvanderwoude.com/escapechars.php

Upvotes: 3

Related Questions