-1

Im working on a batch game and I've run into a major problem, on the main menu whenever i type 1 to launch the new game script it just stays on the menu, even when pressing 4 which is supposed to close the game.

code:

:launcher
cls
type %appdata%\BatchRPG\Source\Assets\logo.txt
echo -------------------------------------------------------------------------------------
echo 1 : NEW GAME
echo 2 : LOAD GAME
echo 3 : SETTINGS
echo 4 : QUIT

set /p input =


if "%input%" EQU "1" (
    call %appdata%\BatchRPG\Source\Scripts\newgame.bat
)
if "%input%" EQU "1" (
    exit
)
goto launcher```
nfgl
  • 2,111
  • 4
  • 14
rip
  • 1
  • 3
  • 2
    Does this answer your question? [Defining and using a variable in batch file](https://stackoverflow.com/questions/10552812/defining-and-using-a-variable-in-batch-file) Specifically, you've created a variable called `%input %`, and since spaces are valid in variable names, there is no variable called `%input%`. Use `set /p "input="` instead. – SomethingDark May 21 '22 at 00:13
  • I'm used to there being a space between the variable name and = sign, my bad. – rip May 21 '22 at 03:23

0 Answers0