Last active
February 20, 2021 18:26
-
-
Save VickyDev986/c1d5022af2e4ebdaf8f421829016200d to your computer and use it in GitHub Desktop.
Credentials Generator Utility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Echo Off | |
cd %~dp0 | |
:UtilityManager | |
CLS | |
ECHO 1. Generate Username | |
ECHO 2. Generate Password | |
ECHO 3. Exit from this tool | |
CHOICE /N /C 123 /M "Select any one of above tasks: " | |
IF %ERRORLEVEL% == 1 (ECHO. & GOTO GenerateUsername) | |
IF %ERRORLEVEL% == 2 (ECHO. & GOTO GeneratePassword) | |
IF %ERRORLEVEL% == 3 (ECHO. & GOTO ExitUtilityManager) | |
:GenerateUsername | |
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | |
echo/> nul|clip & break|clip & type nul|clip & goto|clip & call|clip & exit|clip | |
set alfanum=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_- | |
set username= | |
set /p PLength="Username length ? " | |
FOR /L %%b IN (1,1,%PLength%) DO ( | |
SET /A rnd_num=!RANDOM! * 134 / 65536 + 1 | |
for /F %%c in ('echo %%alfanum:~!rnd_num!^,1%%') do set username=!username!%%c | |
) | |
echo|set /p=%username%|clip | |
setlocal DISABLEEXTDISSIONS DISABLEDELAYEDEXPANSION & endlocal | |
GOTO UtilityManager | |
:GeneratePassword | |
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | |
echo/> nul|clip & break|clip & type nul|clip & goto|clip & call|clip & exit|clip | |
set alfanum=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%_- | |
set password= | |
set /p PLength="Password length ? " | |
FOR /L %%b IN (1,1,%PLength%) DO ( | |
SET /A rnd_num=!RANDOM! * 134 / 65536 + 1 | |
for /F %%c in ('echo %%alfanum:~!rnd_num!^,1%%') do set password=!password!%%c | |
) | |
echo|set /p=%password%|clip | |
setlocal DISABLEEXTDISSIONS DISABLEDELAYEDEXPANSION & endlocal | |
GOTO UtilityManager | |
:ExitUtilityManager | |
DEL /F /S /Q %Temp%\* & DEL /F /S /Q %WinDir%\Temp\* & DEL /F /S /Q %SystemDrive%\Temp\* | |
Setlocal DisableExtensions DisableDelayedExpansion & Endlocal && Exit /b 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Echo Off | |
cd %~dp0 | |
:UtilityManager | |
CLS | |
ECHO 1. Generate Username | |
ECHO 2. Generate Password | |
ECHO 3. Exit from this tool | |
CHOICE /N /C 123 /M "Select any one of above tasks: " | |
IF %ERRORLEVEL% == 1 (ECHO. & GOTO GenerateUsername) | |
IF %ERRORLEVEL% == 2 (ECHO. & GOTO GeneratePassword) | |
IF %ERRORLEVEL% == 3 (ECHO. & GOTO ExitUtilityManager) | |
:GenerateUsername | |
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | |
echo/> nul|clip & break|clip & type nul|clip & goto|clip & call|clip & exit|clip | |
set alfanum=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_- | |
set username= | |
set /p PLength="Username length ? " | |
FOR /L %%b IN (1,1,%PLength%) DO ( | |
SET /A rnd_num=!RANDOM! * 134 / 65536 + 1 | |
for /F %%c in ('echo %%alfanum:~!rnd_num!^,1%%') do set username=!username!%%c | |
) | |
echo|set /p=%username%|clip | |
setlocal DISABLEEXTDISSIONS DISABLEDELAYEDEXPANSION & endlocal | |
GOTO UtilityManager | |
:GeneratePassword | |
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | |
echo/> nul|clip & break|clip & type nul|clip & goto|clip & call|clip & exit|clip | |
set alfanum=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%_- | |
set password= | |
set /p PLength="Password length ? " | |
FOR /L %%b IN (1,1,%PLength%) DO ( | |
SET /A rnd_num=!RANDOM! * 134 / 65536 + 1 | |
for /F %%c in ('echo %%alfanum:~!rnd_num!^,1%%') do set password=!password!%%c | |
) | |
echo|set /p=%password%|clip | |
setlocal DISABLEEXTDISSIONS DISABLEDELAYEDEXPANSION & endlocal | |
GOTO UtilityManager | |
:ExitUtilityManager | |
DEL /F /S /Q %Temp%\* & DEL /F /S /Q %WinDir%\Temp\* & DEL /F /S /Q %SystemDrive%\Temp\* | |
Setlocal DisableExtensions DisableDelayedExpansion & Endlocal && Exit /b 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[-HKEY_CLASSES_ROOT\DesktopBackground\shell\CredentialGeneratorAIOUtility] | |
[-HKEY_CLASSES_ROOT\Directory\Background\shell\CredentialGeneratorAIOUtility] | |
[HKEY_CLASSES_ROOT\DesktopBackground\shell\CredentialGeneratorAIOUtility] | |
@="&Credential Generator AIO Utility" | |
[HKEY_CLASSES_ROOT\DesktopBackground\shell\CredentialGeneratorAIOUtility\command] | |
@="cmd /e:on /v:on /c \"<ParentDirPath>\\CredentialsGeneratorUtility.bat\"" | |
[HKEY_CLASSES_ROOT\Directory\Background\shell\CredentialGeneratorAIOUtility] | |
@="&Credential Generator AIO Utility" | |
[HKEY_CLASSES_ROOT\Directory\Background\shell\CredentialGeneratorAIOUtility\command] | |
@="cmd /e:on /v:on /c \"<ParentDirPath>\\CredentialsGeneratorUtility.bat\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment