China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-27 21:47
中国DOS联盟论坛 » 其它操作系统综合讨论区 » Error input count limit View 1,562 Replies 8
Original Poster Posted 2010-07-10 10:10 ·  中国 广东 东莞 电信
新手上路
Credits 6
Posts 3
Joined 2010-07-02 19:02
15-year member
UID 169876
Gender Male
Status Offline
I'm a new user.. I wrote a bat.. I limited the input to be only between 1-8. If the input is empty or greater than or equal to 9 or something else, it all displays to re-enter..

But how should I limit the number of wrong inputs.. For example, when the continuous wrong input count = 5, force exit.. How to implement..




@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
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
DOSroot -2 2010-07-10 21:03
Floor 2 Posted 2010-07-10 11:18 ·  中国 黑龙江 哈尔滨 联通
版主
★★
系统收藏家
Credits 326
Posts 285
Joined 2010-02-22 00:00
16-year member
UID 160972
Gender Male
From 黑龙江省
Status Offline
This is very simple.
Add :check before password verification
if exist c:\5.pwd goto exit
if exist c:\4.pwd echo 123>5.pwd
if exist c:\3.pwd echo 123>4.pwd
if exist c:\2.pwd echo 123>3.pwd
if exist c:\1.pwd echo 123>2.pwd
if not exist c:\1.pwd echo 123>1.pwd

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
Add after this
if "%i%" gtr "8" goto
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
DOSroot -6 2010-07-10 21:03
Floor 3 Posted 2010-07-10 11:29 ·  中国 黑龙江 哈尔滨 联通
版主
★★
系统收藏家
Credits 326
Posts 285
Joined 2010-02-22 00:00
16-year member
UID 160972
Gender Male
From 黑龙江省
Status Offline
Add the exit part at the end:
:exit
ECHO 123>input.cde
attrib +r +h .\input.cde
echo You cann't input the password!
echo Because you input FIFTH password were wrong.
echo There is any thing-wrong with the progam,
echo after 3 sec. progam EXIT!!
ping -n 3 www.baidu.com>nul
EXIT
If you can't enter the program after five times, you can add at the very beginning of the program:
if exist input.cde goto exit
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
DOSroot -6 2010-07-10 21:04
Floor 4 Posted 2010-07-10 12:12 ·  中国 广东 东莞 电信
新手上路
Credits 6
Posts 3
Joined 2010-07-02 19:02
15-year member
UID 169876
Gender Male
Status Offline
The moderator has worked hard.. I still haven't figured it out..!
Floor 5 Posted 2010-07-10 21:02 ·  中国 上海 电信
管理员
★★
Credits 389
Posts 198
Joined 2008-09-23 12:00
17-year member
UID 126405
Gender Male
Status Offline
This post is transferred from DOS Troubleshooting & Discussion (Q&A Room)

As a moderator, one should abide by the forum's corresponding regulations by setting an example.
http://www.cn-dos.net/forum/viewthread.php?tid=46409
http://www.cn-dos.net/forum/viewthread.php?tid=46315

Deduction of points is for reminder, hope to pay attention in the future.
Floor 6 Posted 2010-07-12 09:40 ·  中国 黑龙江 哈尔滨 联通
版主
★★
系统收藏家
Credits 326
Posts 285
Joined 2010-02-22 00:00
16-year member
UID 160972
Gender Male
From 黑龙江省
Status Offline
I will definitely pay attention in the future
Floor 7 Posted 2010-07-12 09:43 ·  中国 黑龙江 哈尔滨 联通
版主
★★
系统收藏家
Credits 326
Posts 285
Joined 2010-02-22 00:00
16-year member
UID 160972
Gender Male
From 黑龙江省
Status Offline
@echo off
if exist input.cde goto exit
title Easy Go! %username% - %date% - %time%!
color 7F
mode con cols=70 lines=15
:check
if exist c:\5.pwd goto exit
if exist c:\4.pwd echo 123>5.pwd
if exist c:\3.pwd echo 123>4.pwd
if exist c:\2.pwd echo 123>3.pwd
if exist c:\1.pwd echo 123>2.pwd
if not exist c:\1.pwd echo 123>1.pwd
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:Modify window
echo 3:Prompt window
echo 4:QQ
echo 5:Color ball
echo 6:Sina
echo 7:Exit
echo 8:Help...
goto shuru

:88
msg %username% best wishes and see you next time。。。
goto record
exit

:labsys
start "" "D:\Desktop Data\tool\169-0327.exe"
goto record
exit

:change_window
start "" "D:\Desktop Data\tool\Modify Window 0324.exe"
goto record
exit

:Infor_window
start "" "D:\Desktop Data\tool\Prompt Window.exe"
goto record
exit

:sina
start "" "D:\Program Files\TheWorld 2.0\TheWorld.exe" "http://mail.sina.com.cn/"
goto record
exit
:exit
ECHO 123>input.cde
attrib +r +h .\input.cde
echo You cann't input the password!
echo Because you input FIFTH password were wrong.
echo There is any thing-wrong with the progam,
echo after 3 sec. progam EXIT!!
ping -n 3 www.baidu.com>nul
EXIT
Floor 8 Posted 2010-07-14 18:56 ·  中国 上海 杨浦区 电信
管理员
★★
Credits 389
Posts 198
Joined 2008-09-23 12:00
17-year member
UID 126405
Gender Male
Status Offline
I think it's not appropriate to move "Recycle Bin" to "Comprehensive Discussion Area of Other Operating Systems", and it's obviously more suitable to move it to the "Batch Processing" section.
Floor 9 Posted 2010-07-28 13:44 ·  中国 黑龙江 哈尔滨 联通
版主
★★
系统收藏家
Credits 326
Posts 285
Joined 2010-02-22 00:00
16-year member
UID 160972
Gender Male
From 黑龙江省
Status Offline
Does the batch processing section also accept Windows-related content?
Forum Jump: