I have a script that searches for a running process (notepad) and it will stay runnning until notpad is no longer running:
:search
TASKLIST|FIND "notepad.exe" >nul 2>&1
IF %ERRORLEVEL% equ 0 (GOTO found)
timeout 3 > nul
GOTO search
:found
exit
What i'd like to insert here is a prompt for keypress to exit this loop and jump to :foundIf no keypress is entered the file keep looking for notepad until it closes.