Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. @Echo Off
  2. mode con: cols=70 lines=25
  3. :start
  4. color 8a
  5. echo ----------------------------------------------------------------------
  6. echo -------- Password Generator -------
  7. echo ----------------------------------------------------------------------
  8. echo.
  9. echo.
  10. Echo Hello %username%
  11. set /P lengthnumberuser="What length do you want your password to be?:
  12. cls
  13. Setlocal EnableDelayedExpansion
  14. Set _RNDLength=%lengthnumberuser%
  15. Set _Alphanumeric=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%%$$@@**
  16. Set _Str=%_Alphanumeric%987654321
  17. :_LenLoop
  18. IF NOT "%_Str:~18%"=="" SET _Str=%_Str:~9%& SET /A _Len+=9& GOTO :_LenLoop
  19. SET _tmp=%_Str:~9,1%
  20. SET /A _Len=_Len+_tmp
  21. Set _count=0
  22. SET _RndAlphaNum=
  23. :_loop
  24. Set /a _count+=1
  25. SET _RND=%Random%
  26. Set /A _RND=_RND%%%_Len%
  27. SET _RndAlphaNum=!_RndAlphaNum!!_Alphanumeric:~%_RND%,1!
  28. If !_count! lss %_RNDLength% goto _loop
  29. echo.
  30. echo.
  31. echo.
  32. cls
  33. Echo Password is: !_RndAlphaNum!
  34. set /p _detail=Please Record a description for this password:
  35. echo.
  36. echo %date%---%_detail%----!_RndAlphaNum! >> RandPass.txt
  37. echo Password Saved with Details to RandPass.txt for future reference.
  38. echo.
  39. echo.
  40. set /p _newpass= Would you like to create another password ?[y/n]:
  41. cls
  42.  
  43. If /i "%_newpass%"== "y" GOTO :start else :end
  44.  
  45. :end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement