I wrote a batch file for a legacy DOS system for games that do not run on Win32. The code works fine under XP x86 but when I run it in 98SE or in DOS I get a Syntax Error after the first prompt. The file runs through into a loop thanks to goto. How do I fix this?
Source code:
@echo off
:PROMPT
cls
echo.
echo Welcome to the Game Selection Wizard!
echo --------------------------------------
echo.
echo Please Select a Game:
echo.
echo 1. Game1
echo 2. Game2
echo 3. Return To MS-DOS
echo.
set /p GAME= Your Current Selection:
if %game%==1 goto Game1
if %game%==1. goto Game1
if %game%==2 goto Game2
if %game%==2. goto Game2
if %game%==3 goto QUIT
if %game%==3. goto QUIT
goto INVALID
:INVALID
cls
echo.
echo * * * * * * * * * * * * * * * * * * * * * * * * * * *
echo * *
echo * ERROR: *
echo * ------ *
echo * The choice you selected is wrong. Try Again! *
echo * *
echo * * * * * * * * * * * * * * * * * * * * * * * * * * *
echo.
echo Welcome to the Game Selection Wizard!
echo -------------------------------------
echo.
echo Please Select a Game:
echo.
echo 1. Game1
echo 2. Game2
echo 3. Return To MS-DOS
echo.
set /p gameerror= Your Current Selection:
if %gameerror%==1 goto Game1
if %gameerror%==1. goto Game1
if %gameerror%==2 goto Game2
if %gameerror%==2. goto Game2
if %gameerror%==3 goto QUIT
if %gameerror%==3. goto QUIT
cls
goto INVALID
:Game1
cls
call A:\GAMES\Game1.exe
goto PROMPT
:Game2
cls
call A:\GAMES\Game2.exe
goto PROMPT
:QUIT
cls
echo.
echo Are you sure you want to return to MS-DOS?
echo.
set /p quit= Confirmation:
if %quit%==y goto DIE
if %quit%==Y goto DIE
if %quit%==yes goto DIE
if %quit%==Yes goto DIE
if %quit%==YES goto DIE
if %quit%==n goto PROMPT
if %quit%==N goto PROMPT
if %quit%==no goto PROMPT
if %quit%==No goto PROMPT
if %quit%==NO goto PROMPT
goto QUITERROR
:QUITERROR
cls
echo * * * * * * * * * * * * * * * * * * * * * * * * * * *
echo * *
echo * ERROR: *
echo * ------ *
echo * The choice you selected is wrong. Try Again! *
echo * *
echo * * * * * * * * * * * * * * * * * * * * * * * * * * *
echo.
echo Are you sure you want to return to MS-DOS?
echo.
set /p quiterror= Confirmation:
if %quiterror%==y goto DIE
if %quiterror%==Y goto DIE
if %quiterror%==yes goto DIE
if %quiterror%==Yes goto DIE
if %quiterror%==YES goto DIE
if %quiterror%==n goto PROMPT
if %quiterror%==N goto PROMPT
if %quiterror%==no goto PROMPT
if %quiterror%==No goto PROMPT
if %quiterror%==NO goto PROMPT
goto QUITERROR
:DIE
cls
echo.
echo Returning to MS-DOS...