scripts-win/passgen/passgen.cmd

33 lines
686 B
Batchfile
Raw Normal View History

2021-11-26 21:01:09 +00:00
@echo off
REM - Attention encodage OEM-850
REM - Options
ver=1.0
setlocal enableextensions enabledelayedexpansion
title PassGen %ver%
:menu
cls
echo Pour des raisons de lisibilit<69>, les caract<63>res suivants ne seront pas utilis<69>s :
echo "O" lettre O majuscule
echo "0" chiffre z<>ro
echo "l" lettre L minuscule
echo "1" chiffre un
echo.
:pass
set /P _length=Password Length: %==%
REM set _length=8
set /a z = %_length%
set "string=ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz123456789"
set "password="
for /L %%i in (1,1,!z!) do call :_genRand
echo Password is: %password%
pause > NUL
goto :menu
:_genRand
set /a x=%random% %% 62
set password=%password%!string:~%x%,1!
goto :eof