DOS – Exit on key pressed

GOTO:EOF command will end a DOS batch application no matter whether subsequent code follow.

Adding a PAUSE command will allow the user to inspect screen outputs before the application window disappears. Forcing an empty line via ECHO will nicely separate the "Press any key to continue" message created by the PAUSE command from any previous output.

Script

::: -- End of application --
ECHO.&PAUSE&GOTO:EOF
SOURCE

LINK

LANGUAGE
ENGLISH