echo Default is option 1, automatically starts after 5 seconds
echo.
set /P choice= Please enter whether to reboot immediately (1 immediately / 2 later)...
wait 5
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
IF /I '%Choice%'=='1' GOTO drv
IF /I '%Choice%'=='2' GOTO igr
::If no choice is made, go to the default choice
echo You did not make a choice, this is the default
goto exit
:drv
echo You chose to reboot immediately
exit
:igr
echo You chose to reboot later
exit
:exit
exit
++++++++++++++++++++++++++
I used wait, and it works, but set /p intercepts it
so it can't achieve the expected result
And if I use wait directly, the selection message above disappears
echo.
set /P choice= Please enter whether to reboot immediately (1 immediately / 2 later)...
wait 5
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
IF /I '%Choice%'=='1' GOTO drv
IF /I '%Choice%'=='2' GOTO igr
::If no choice is made, go to the default choice
echo You did not make a choice, this is the default
goto exit
:drv
echo You chose to reboot immediately
exit
:igr
echo You chose to reboot later
exit
:exit
exit
++++++++++++++++++++++++++
I used wait, and it works, but set /p intercepts it
so it can't achieve the expected result
And if I use wait directly, the selection message above disappears
