So I've noticed that when I start my batch file and come to a user prompt, if "Enter" is the first key pressed, the file will terminate. If "Enter" is pressed on the second or subsequent try, the file behaves normally (and follows the goto back to the menu again). Why does this happen and/or how can I prevent it from happening? I tried using pause and timeout but spamming enter will still crash it.
To explain using the code below, if A is pressed, we goto :hello. Else we return to :menu. This works for any key except enter. If you hit enter you crash. But if you hit something else, reload menu, then enter reloads as well.
Example code below:
@echo off:menuecho A: Helloset /p _input=Choice? if %_input%==A goto hellogoto menu:helloecho Hello!pauseexit