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-08-12 05:08
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Dynamic password verification with a simulated progress bar View 1,781 Replies 12
Original Poster Posted 2008-12-11 21:57 ·  中国 湖南 益阳 电信
贫困用户
Credits -7
Posts 3
Joined 2007-12-09 00:04
18-year member
UID 105101
Gender Male
Status Offline
```batch
@echo off &title Dynamic Password Verification
::::******************************************************************
::::Explanation of getting the correct password:
::::If the displayed access time on the interface is Thursday, December 11, 2008, 21:13
::::Then the correct password is the day + hour + minute, that is, the six-digit number 112113!!!
::::******************************************************************
::::■〓■〓■〓■〓■ Program initialization starts ■〓■〓■〓■〓■
@mode con cols=101 lines=27
color 0a
:mum
call :xsp
call :fz
echo." ^-^ If you don't know the password, please press the Q key to exit this program! ^-^
echo.
set /p name= Please enter the 6-digit access password:
::::Judge whether to exit the program.
SET choice=%name:~0,1%
if /i "%choice%"=="Q" goto endd
::::---------------------------------
SET name=%name:~0,6%
::::Start verifying the password:::::::::
goto :pass
::::Password verification passed:::::::::
:aabbcc
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::The following can write the operation commands that can only be executed after passing the password verification.


















::::::::::The following are some called procedures. That is, subroutines.
goto :eof
::::::::::::: This is the first interface when the program runs ::::::::::::::::
:xsp
cls
SET rq=%date:~0,16%
SET sj=%time:~0,5%
set mima=%rq% %sj%
call :mima %mima%
echo.
echo.
echo. """"""""""""""""""""""""""""""""""""""""""""""""
echo. "┏━━━━━━━━━━━━━━━━━━━━━┓"
echo. "┃ \\\|/// ┃"
echo. "┃ \\ - - // ┃"
echo. "┃ ( @ @ ) ┃"
echo. "┃ ┏━━━━━━━━━oOOo-(_)-oOOo━┓ ┃"
echo. "┃ ┃ ┃ ┃"
echo. "┃ ┃ Hello! Welcome! ┃ ┃"
echo. "┃ ┃ ┃ ┃"
echo. "┃ ┃ Your access time this time is: ┃ ┃"
echo. "┃ ┃ ┃ ┃"
echo. "┃ ┃ %mima% ┃ ┃"
echo. "┃ ┃ Oooo ┃ ┃"
echo. "┃ ┗━━━━━━━━━ oooO ━( )━┛ ┃"
echo. "┃ ( ) ) / ┃"
echo. "┃ \ ( (_/ ┃"
echo. "┃ \_) ┃"
echo. "┗━━━━━━━━━━━━━━━━━━━━━┛"
echo. """"""""""""""""""""""""""""""""""""""""""""""""
echo.
:::: pause
goto :eof
:::: Assign values to variables
:fz
set name=
set aa1=
set aa2=
set aa3=
set aa4=
set aa5=
set aa6=
goto :eof
:name
echo. %1
set pass=%1
set aa1=%pass:~0,1%
set aa2=%pass:~1,1%
set aa3=%pass:~2,1%
set aa4=%pass:~3,1%
set aa5=%pass:~4,1%
set aa6=%pass:~5,1%
echo. %aa1%-%aa2%-%aa3%-%aa4%-%aa5%-%aa6%
goto :eof
::::: Generate dynamic password ::::::::::::::::::::::
:mima
::::echo. %1 %2 %3
set pass1=%1
set pass2=%2
set pass3=%3
set aa1=%pass1:~8,1%
set aa2=%pass1:~9,1%
set aa3=%pass3:~0,1%
set aa4=%pass3:~1,1%
set aa5=%pass3:~3,1%
set aa6=%pass3:~4,1%
::::echo. %aa1%-%aa2%-%aa3%-%aa4%-%aa5%-%aa6%
set pass=%aa1%%aa2%%aa3%%aa4%%aa5%%aa6%
::::echo. %pass%
goto :eof
::::::Verify password::::::::::::::::::::::::::::::::
:pass
:::: =====Display password verification status with simulated progress bar=====
set a1=
set b1=
set c1=
::::■〓■〓■〓■〓■ Enable variable delay ■〓■〓■〓■〓■
setlocal enabledelayedexpansion
:::------------------------------------------------------
::::Here loop 100 times. The effect of calling subroutine:sub is to output 100 > to form >>>>>>>>>>
for /l %%n in (1 1 100) do call :sub
::::■〓■〓■〓■〓■ Disable variable delay ■〓■〓■〓■〓■
setlocal DISABLEDELAYEDEXPANSION
:::: =======================================
IF NOT "%pass%"=="%name%" goto :cw
call :zq
goto :aabbcc
goto :eof
::::::Display information for incorrect password verification result::::::::::::::
:cw
echo. Unfortunately, the access password you entered is invalid, please re-enter:
pause
goto :mum
goto :eof
::::::Display information for correct password verification result::::::::::::::
:zq
echo." ^-^ Congratulations! The password has passed verification!
pause
goto :eof
rem ■〓■〓■The following is the subroutine for simulating the progress bar■〓■〓■
:sub
rem --------------------------------------------
rem set /a c1= %c1% + 1 The command is abbreviated as follows:
set /a c1+=1
rem --------------------------------------------
set /a a1=%c1%
::::Clear the screen and output 20 blank lines.
cls && for /l %%n in (1 1 20) do echo.
echo.
echo Please be patient, verifying the password, completed !a1! %%
rem After enabling variable delay effect for variable b1, add the > symbol to the original value of variable b1 and then assign it to variable b1
set b1=!b1!^>&& echo !b1!
ping /n 1 127.0.0.1>nul
goto :eof







Trial download address of this batch processing http://upload.cn-dos.net/img/1185.rar
http://upload.cn-dos.net/img/1185.rar

::::

[ Last edited by lj249911023 on 2008-12-12 at 08:57 ]
```
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
HAT +2 2008-12-11 22:16
rs369007 +2 2008-12-12 23:29
Floor 2 Posted 2008-12-11 22:16 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Floor 3 Posted 2008-12-11 22:20 ·  中国 湖南 益阳 电信
贫困用户
Credits -7
Posts 3
Joined 2007-12-09 00:04
18-year member
UID 105101
Gender Male
Status Offline
Here are the translations:

Below are the effect pictures:


If there are BUGs, experts please help correct.

::::******************************************************************
::::Explanation for getting the correct password:
::::If the displayed access time on the interface is Thursday, December 11, 2008 21:13
::::Then the correct password is day + hour + minute, that is, the six-digit number 112113!!!
::::******************************************************************




Thanks for providing opinions!

Trial download address of this batch processing http://upload.cn-dos.net/img/1185.rar


》》

[ Last edited by lj249911023 on 2008-12-12 at 08:48 ]
Floor 4 Posted 2008-12-11 23:51 ·  中国 湖南 郴州 电信
初级用户
★★
Credits 87
Posts 61
Joined 2008-09-18 11:32
17-year member
UID 125941
Gender Male
Status Offline
Floor 5 Posted 2008-12-12 23:29 ·  中国 四川 攀枝花 电信
初级用户
★★
Credits 147
Posts 131
Joined 2008-09-22 23:54
17-year member
UID 126352
Gender Male
Status Offline
Floor 6 Posted 2008-12-12 23:55 ·  中国 四川 攀枝花 电信
初级用户
★★
Credits 147
Posts 131
Joined 2008-09-22 23:54
17-year member
UID 126352
Gender Male
Status Offline
Study more! Good ideas!
Floor 7 Posted 2008-12-13 14:23 ·  中国 台湾 中华电信(HiNet)数据中心
初级用户
Credits 26
Posts 25
Joined 2008-11-07 16:06
17-year member
UID 130293
Gender Male
Status Offline
Hehe, I'll also take it away and study it slowly.
Floor 8 Posted 2008-12-15 17:36 ·  中国 广东 深圳 电信
初级用户
★★
游手好闲 + 无所事事 ..
Credits 194
Posts 167
Joined 2007-04-30 09:43
19-year member
UID 87022
Gender Male
Status Offline
I think the algorithm is the key. If it's obtained using hours, minutes and seconds, I think it can be completely implemented with more concise code.

The following progress bar... It seems to have no practical meaning?

In addition, there is a problem in the place where Q is judged at the top. If the user enters the password as QXXX, it will also exit.

[ Last edited by exzzz on 2008-12-15 at 17:37 ]
Floor 9 Posted 2009-06-01 01:01 ·  中国 河南 安阳 联通
新手上路
Credits 8
Posts 8
Joined 2008-11-13 16:45
17-year member
UID 130863
Gender Male
Status Offline
<img src"http://www.freezing2688.cn/images/y.jpg"></img>
Floor 10 Posted 2009-06-20 06:21 ·  中国 河南 新乡 电信
初级用户
★★
Credits 96
Posts 83
Joined 2009-06-04 00:54
17-year member
UID 146648
Gender Male
From 信阳
Status Offline
Admired to the point of complete折服!
Floor 11 Posted 2009-06-20 21:52 ·  中国 广东 广州 联通
新手上路
Credits 7
Posts 7
Joined 2009-06-10 06:51
17-year member
UID 147085
Gender Male
Status Offline
Can the password be changed into *** symbols?
Floor 12 Posted 2009-06-20 22:55 ·  中国 广东 广州 番禺区 电信
初级用户
★★
l i u s s
Credits 73
Posts 101
Joined 2008-09-17 00:21
17-year member
UID 125825
Gender Male
From GZ
Status Offline
Floor 13 Posted 2009-06-21 22:39 ·  中国 江苏 无锡 电信
初级用户
Credits 92
Posts 42
Joined 2007-08-14 09:14
18-year member
UID 95100
Gender Male
From 重庆市巫山县
Status Offline
The building above, yours is also too long?

Just post one occasionally, but it doesn't support special characters like F1, F2, etc., hehe:)



  1. @echo off&cls
  2. chcp 437>nul
  3. ::&graftabl 936>nul
  4. for /f "delims=: tokens=1" %%i in ('findstr /i /n "^:writepass$" "%~f0"') do set line=%%i
  5. <"%~f0" more +%line%|debug>nul
  6. set "ps="
  7. set n=0
  8. set /p=Enter password:<nul
  9. :start
  10. if %n%==256 (
  11. echo  &&goto e
  12. ) else (
  13. for /f "delims=" %%i in ('password.com') do (
  14. if "%%i"=="?" goto e
  15. set "q=%%i"
  16. if "%%i" equ "?" (call :p "%%i") else (
  17. if "%%i" lss "? " (GOTO :start)
  18. set /p=*<nul
  19. set /a n+=1
  20. if "%%i" geq "? " call set "ps=%%ps%%%%q:~1%%"
  21. )))
  22. goto start

  23. :p
  24. if not "%ps%" equ "" (
  25. set "ps=%ps:~0,-1%"
  26. SET /p=  <nul
  27. )
  28. GOTO :eof

  29. :e
  30. :::Here you can do what you wanna do:::
  31. echo.
  32. echo password:"%ps%"
  33. del password.com
  34. pause>nul
  35. goto :eof
  36. ::下面的请不要随便修改::

  37. :writepass
  38. A
  39. MOV DX,111
  40. MOV AH,09
  41. INT 21
  42. MOV AH,01
  43. INT 21
  44. MOV AH,4C
  45. INT 21
  46. INT 20
  47. DB '?'24 0D 0A 1A

  48. R CX
  49. 108
  50. N password.com
  51. W
  52. Q

Yovie 2009-06-22 09:29


[ Last edited by yovie on 2009-6-21 at 22:47 ]
拾人牙慧者!
Forum Jump: