批量密码生成器 [英] Batch password generator
本文介绍了批量密码生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试从youtube运行密码生成器. 这是代码:
I tried to run password generator from youtube. Here's the code:
@echo off
chcp 1257
setlocal EnableDelayedExpansion
set alpha=
aąbcčdeęėfghiįjklmnopqrsštuųūvwxyzžAĄBCČDEĘĖFGHIĮJKLMNOPQRSŠTUŲŪVWXYZŽ
For /L %%j in (1,1,13) DO CALL:GEN
echo Your Random Password is [ %PASSWORD% ]
EndLocal
pause
:GEN
For /L %%j in (1,1,10) DO (
if %random% gtr 10000 ( set PASSWORD=%PASSWORD%%random:~0,1% ) else (
set /a i=%random:~1,1%+%random:~1,1%
if !i! gtr 25 set i=25
set PASSWORD=%PASSWORD%!alpha:~%i%,1! )
)
这将返回1个随机密码.而且我需要10个密码,因此我尝试在此行之前创建for循环:对于(1,1,13)中的/L %% j,请执行CALL:GEN.然后它返回10行文本,但没有密码:
This returns 1 random password. And I need 10 passwords, so I tried to create for loop before this line: For /L %%j in (1,1,13) DO CALL:GEN . Then it returns 10 rows of text but without passwords:
Active code page: 1257
Your Random Password is [ ]
Your Random Password is [ ]
Your Random Password is [ ]
Your Random Password is [ ]
Your Random Password is [ ]
Your Random Password is [ ]
Your Random Password is [ ]
Your Random Password is [ ]
Your Random Password is [ ]
Your Random Password is [ ]
Press any key to continue . . .
我该如何解决?
推荐答案
@echo off & setlocal EnableDelayedExpansion
chcp 1257
set "alpha=aabccdeeefghiijklmnopqrsštuuuvwxyzžAABCCDEEEFGHIIJKLMNOPQRSŠTUUUVWXYZŽ"
set alphaCnt=70
For /L %%j in (1,1,10) DO CALL :GEN %%j
pause
Goto :Eof
:GEN
Set "Password="
For /L %%j in (1,1,10) DO (
Set /a i=!random! %% alphaCnt
Call Set PASSWORD=!PASSWORD!%%alpha:~!i!,1%%
)
echo Your Random Password %1 is [%PASSWORD%]
示例输出:
Your Random Password 1 is [EÜllxleUOc]
Your Random Password 2 is [RBGEoÄulEF]
Your Random Password 3 is [AfuuAEFwMe]
Your Random Password 4 is [kuaEjuLicr]
Your Random Password 5 is [ModgGsANÄE]
Your Random Password 6 is [MzEqSWJWCB]
Your Random Password 7 is [oÜcrFUqGpj]
Your Random Password 8 is [kRHDCqiciÜ]
Your Random Password 9 is [gUYjjSiicQ]
Your Random Password 10 is [cuuAOÜixVY]
这篇关于批量密码生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文