嘿,如果他没有输入任何程序退出的任何内容,是否可以批量制作一个等待用户 10 秒输入任何内容的程序?如果是怎么办?
问问题
839 次
2 回答
1
尝试这个:
choice /c [your key(s)][any different key] /n /d [2nd key] /t 10>nul
if %errorlevel% equ 1 (do stuff here)
if %errorlevel% equ 2 exit /b
尝试使用选择/?寻求更多帮助。
于 2016-05-14T03:16:30.293 回答
1
Give it a shot
@echo off
choice /t 10 /c ynr /cs /d r /m "Do you want it (Y/N)?"
if errorlevel 3 exit
if errorlevel 2 goto :no
if errorlevel 1 goto :yes
:yes
@echo You typed yes
GOTO :continue
:no
@echo You typed no
GOTO :continue
:continue
@echo And on we go
pause
于 2016-05-14T09:33:18.280 回答