@echo off
:main
:: Put all your code here under the "main" sub-routine
echo EXECUTED MAIN
goto rerun_prompt
:rerun_prompt
ECHO Re-run the script? [Y/N]:
SET /p choice=
IF /I %choice% == Y goto main
IF /I %choice% == N (
echo Exiting...
EXIT
)
ECHO "%choice%" is not valid, try again
goto rerun_prompt