我是新人。。寫了一個bat .
我限定了輸入只能在1-8之間,如果輸入為空 或者大於等於9 或者其他的都
顯示重新輸入。。
但是我該如何限定 錯誤輸入的次數。。
比如 當連續錯誤輸入次數=5時。強行退出。。
該如何實現。。
@echo off
title Easy Go! %username% - %date% - %time%!
color 7F
mode con cols=70 lines=15
echo Read carefully for the first time
echo 1.If you need help please input 7!
echo 2.If you have some good suggestions
echo can send mails to "shmilyfriend@sina.com" or shmilyfriend@126.com
echo Please input the number
:shuru
set /p i=i:
if "%i%"=="" goto shuru
if %i% GEQ 9 goto tishi
if "%i%"=="1" GOTO labsys
if "%i%"=="2" GOTO change_window
if "%i%"=="3" GOTO Infor_window
if "%i%"=="4" GOTO QQ
if "%i%"=="5" GOTO color ball
if "%i%"=="6" GOTO sina
if "%i%"=="7" GOTO help
if "%i%"=="8" GOTO 88
:tishi
echo wrong number! pls input again
GOTO shuru
:record
echo %date% -%time% -%username% use %i% >>d:\test1.txt
exit
:color ball
start "" "D:\03.exe"
goto record
exit
:QQ
start "" "D:\program files\tencent\qq\bin\qq.exe"
goto record
exit
:help
echo 1 :labsys
echo 2:修改窗口
echo 3:提示窗口
echo 4:QQ
echo 5:彩球
echo 6:Sina
echo 7:離開
echo 8:幫助。。。
goto shuru
:88
msg %username% best wishes and see you next time。。。
goto record
exit
:labsys
start "" "D:\桌面資料\tool\169-0327.exe"
goto record
exit
:change_window
start "" "D:\桌面資料\tool\修改窗口0324.exe"
goto record
exit
:Infor_window
start "" "D:\桌面資料\tool\提示窗口.exe"
goto record
exit
:sina
start "" "D:\Program Files\TheWorld 2.0\TheWorld.exe" "http://mail.sina.com.cn/"
goto record
exit
我限定了輸入只能在1-8之間,如果輸入為空 或者大於等於9 或者其他的都
顯示重新輸入。。
但是我該如何限定 錯誤輸入的次數。。
比如 當連續錯誤輸入次數=5時。強行退出。。
該如何實現。。
@echo off
title Easy Go! %username% - %date% - %time%!
color 7F
mode con cols=70 lines=15
echo Read carefully for the first time
echo 1.If you need help please input 7!
echo 2.If you have some good suggestions
echo can send mails to "shmilyfriend@sina.com" or shmilyfriend@126.com
echo Please input the number
:shuru
set /p i=i:
if "%i%"=="" goto shuru
if %i% GEQ 9 goto tishi
if "%i%"=="1" GOTO labsys
if "%i%"=="2" GOTO change_window
if "%i%"=="3" GOTO Infor_window
if "%i%"=="4" GOTO QQ
if "%i%"=="5" GOTO color ball
if "%i%"=="6" GOTO sina
if "%i%"=="7" GOTO help
if "%i%"=="8" GOTO 88
:tishi
echo wrong number! pls input again
GOTO shuru
:record
echo %date% -%time% -%username% use %i% >>d:\test1.txt
exit
:color ball
start "" "D:\03.exe"
goto record
exit
start "" "D:\program files\tencent\qq\bin\qq.exe"
goto record
exit
:help
echo 1 :labsys
echo 2:修改窗口
echo 3:提示窗口
echo 4:QQ
echo 5:彩球
echo 6:Sina
echo 7:離開
echo 8:幫助。。。
goto shuru
:88
msg %username% best wishes and see you next time。。。
goto record
exit
:labsys
start "" "D:\桌面資料\tool\169-0327.exe"
goto record
exit
:change_window
start "" "D:\桌面資料\tool\修改窗口0324.exe"
goto record
exit
:Infor_window
start "" "D:\桌面資料\tool\提示窗口.exe"
goto record
exit
:sina
start "" "D:\Program Files\TheWorld 2.0\TheWorld.exe" "http://mail.sina.com.cn/"
goto record
exit
本帖最近评分记录
(共 1 条)
点击查看详情
| 评分人 | 分数 | 时间 |
|---|---|---|
| DOSroot | -2 | 2010-07-10 21:03 |
