'Cmd exits after putting enter at press any key. (notepad)

the code looks like this:

echo 1. Start
echo 2. Info
echo 3. Exit
echo.
pause

set /p menuchoice=

if %menuchoice% == 1 goto startgame
if %menuchoice% == 2 goto info
if %menuchoice% == 3 exit
goto menu

The menu comes in with pressing enter once for Press any key, but at the choosing place i have to put enter twice and then it just exits, but i want it to go back to the menu. Also if its possible, i have to know: is there a way that i can make it choose something if i press the number without the confirmation enter? (sorry for bad english)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source