联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
CODE: [Copy to clipboard]@echo off wait 5 Please input the number "1" or "2" or "3" if errorlevel 255 goto error if errorlevel 51 goto 3 if errorlevel 50 goto 2 if errorlevel 49 goto 1 if errorlevel 0 goto null :error echo Error occured! rem 楼主的“ekede”既不像拼音也不像日文的罗马拼音,我猜应该是Occured goto end :1 echo 1 is called goto end :2 echo 2 is called goto end :3 echo 3 is called goto end :null echo Nothing happened :p :end
CODE: [Copy to clipboard]@echo off choice /n /cABCDEFGHIJKLMNOPQRSTUVWXYZ Input a letter: for %%d in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if errorlevel H%%d set letter=%%D echo Your letter "%letter%"
CODE: [Copy to clipboard]@echo off choice /n /cABCDEFGHIJKLMNOPQRSTUVWXYZ Input a letter: for %%d in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if errorlevel x%%d set letter=%%D echo Your letter "%letter%"
CODE: [Copy to clipboard]@echo off choice /n /c###0123456789 Input a number: for %%d in (0 1 2 3 4 5 6 7 8 9) do if errorlevel J%%d set numer=%%D echo Your number "%number%"
CODE: [Copy to clipboard]@echo off choice /n /c#########0123456789 Input a number: for %%d in (0 1 2 3 4 5 6 7 8 9) do if errorlevel 1%%d set numer=%%D echo Your number "%number%"