Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Echo Off
- mode con: cols=70 lines=25
- :start
- color 8a
- echo ----------------------------------------------------------------------
- echo -------- Password Generator -------
- echo ----------------------------------------------------------------------
- echo.
- echo.
- Echo Hello %username%
- set /P lengthnumberuser="What length do you want your password to be?:
- cls
- Setlocal EnableDelayedExpansion
- Set _RNDLength=%lengthnumberuser%
- Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%%$$@@**
- Set _Str=%_Alphanumeric%987654321
- :_LenLoop
- IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
- SET _tmp=%_Str:~9,1%
- SET /A _Len=_Len+_tmp
- Set _count=0
- SET _RndAlphaNum=
- :_loop
- Set /a _count+=1
- SET _RND=%Random%
- Set /A _RND=_RND%%%_Len%
- SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
- If !_count! lss %_RNDLength% goto _loop
- echo.
- echo.
- echo.
- cls
- Echo Password is: !_RndAlphaNum!
- set /p _detail=Please Record a description for this password:
- echo.
- echo %date%---%_detail%----!_RndAlphaNum! >> RandPass.txt
- echo Password Saved with Details to RandPass.txt for future reference.
- echo.
- echo.
- set /p _newpass= Would you like to create another password ?[y/n]:
- cls
- If /i "%_newpass%"== "y" GOTO :start else :end
- :end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement