scripts-win/passgen/passgen.cmd

33 lines
686 B
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@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, les caractŠres suivants ne seront pas utiliss :
echo "O" lettre O majuscule
echo "0" chiffre zro
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