How do I test for button press on pause command in batch? -
i writing batch script, in user reads disclaimer, press key continue, or "e" exit. looks this:
@echo off echo (some disclaimer text here) echo. echo once understand message, press key continue, or press "e" exit. ::i know pause doesn't take input, i'm using placeholder pause>nul cls echo welcome! pause is there way accomplish this? thanks!
to clarify, want exit second press e key. have seen done before, forgot saw it.
choice.exe describe, though doesn't have option "any key". can specify specific key such "y" below.
echo once understand message, press "y" continue, or press "e" exit. choice /c ey if errorlevel 2 goto :welcome if errorlevel 1 goto :canceled rem user pressed ctrl+c :canceled rem user pressed e. cancel stuff. goto :eof :welcome rem user pressed y. welcome stuff echo welcome!
Comments
Post a Comment