
求助本人剛學cmd寫了一個小case請教各位大蝦
- @echo off
- color a
- echo 本程序判斷輸入的是A還是B,按O鍵退出程序。
- :D
- set /p input=請輸入字母A或B或者輸入O退出:
- if %input%==A goto A
- if %input%==B goto B
- if %input%==O goto C
- if %input%== goto D
- echo 您輸入了錯誤的字符,請重新輸入,ps:CMD是區分大小寫的哦(^o^)/~
- goto D
- :A
- echo 您輸入的字母是A
- ping -n 2 127.0.0.1>null
- goto D
- :B
- echo 您輸入的字母是B
- ping -n 2 127.0.0.1>null
- goto D
- :C
- echo 您選擇了退出,將在3秒鐘后退出本程序。
- ping -n 3 127.1>null
- del null
- exit
nclick="copycode($('code0'));">復制代碼
但是在輸入了A或者B以后,出現提示信息再次輸入A或者B時,直接敲回車,顯示的卻是上次的結果。。[attach]4337[/attach]求解?(難道cmd默認為輸入回車是輸入的上一次的命令?)