[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[其他] 求助批处理动态密码问题

各位大神好!
如各位大神有能力请帮忙做个批处理:一次生成三个密码(5位数),三个密码生成时保存时间到配置文件中,结束时间是1小时(下次打开的时候时间相差大于等于一小时重换密码,三个密码用哪个都行,一个密码只能用1次,,不能用的加入黑名单配置文件中)

不是我不想做,不练,不写,是真的因为本人代码风格笨拙,也没有能力!


以下贴出本人代码(不要运行,也不要改)
  1. @echo off
  2. Setlocal EnableDelayedExpansion
  3. setlocal enableextensions
  4. :lodd
  5. if not exist conf.ini goto hua
  6. if not exist pwd goto hua
  7. set tme=%date:~0,4%%date:~5,2%%date:~8,2%
  8. call :line conf.ini Date tmp
  9. call :line conf.ini MaxER tmp1
  10. call :read2 tmp
  11. call :read3 err
  12. call :read1 tmp1
  13. echo %max% %ec% %wct%
  14. pause
  15. if "%ec%" GEQ "%tme%" set/a %wct%+1=wct
  16. if "%wct%" GTR "%max%" exit
  17. goto main
  18. :main
  19. echo %wct%>err
  20. echo.
  21. echo.
  22. echo 动态密码2022/11/16 失效
  23. echo.
  24. echo.
  25. pause
  26. cls
  27. echo.
  28. set/p ab=密码:
  29. call :pwd %ab% pwd
  30. goto main
  31. :line
  32. (for /f "delims=" %%a in (%1) do (
  33.     set str=%%a
  34.     if "!str:~,1!"=="[" (
  35.         if "%%a"=="[%2]" (
  36.             set n=true
  37.         ) else (
  38.             set n=
  39.         )
  40.     ) else if defined n (
  41.         echo,%%a
  42.     )
  43. ))>%3
  44. goto :eof
  45. :hua
  46. if exist pwd del pwd /s /q /f >nul
  47. echo %random%-%random%-%random%>pwd
  48. ECHO 完成.
  49. goto lodd
  50. :pwd
  51. cd /d "%~dp0"
  52. set "return=NotFound"
  53. set "input=Nothing"
  54. set "input=%1"
  55. for /f "delims=:" %%i in ('type "%2" ^| findstr /n /l /x /c:"%input%"') do (
  56.     set "return=%%i"
  57. )
  58. if "%rerurn%"=="NotFound" goto main
  59. if "%input%"=="Nothing" goto main&set /a wct=%wct%+1
  60. call :del %return%
  61. goto install
  62. :del
  63. for /f "delims=" %%i in ('%1') do (
  64.         (set n=0
  65.         for /f "delims=" %%j in ('type "%%i"') do (
  66.                 set /a n+=1
  67.                 if not "!n!"=="1" echo %%j
  68.         ))>$
  69.         move $ "%%i">nul
  70. )
  71. :read1
  72. for /f "delims=" %%i in (%1) do (
  73.     set max=%%i
  74. )
  75. goto :eof
  76. :read2
  77. for /f "delims=" %%m in (%1) do (
  78.     set ec=%%i
  79. )
  80. goto :eof
  81. :read3
  82. for /f "delims=" %%b in (%1) do (
  83.     set wct=%%i
  84. )
  85. goto :eof
  86. :err
  87. echo.
  88. echo 不能找到文件!
  89. pause>nul
  90. exit
  91. :install
  92. pause
  93. exit
复制代码
本人已死,不用联系,要联系下来联系~

返回列表