Created
January 31, 2023 20:33
-
-
Save jbulies/3f1347370dfc406ed0433d338e122d4f to your computer and use it in GitHub Desktop.
Generate a random string (Batch Script)
This file contains hidden or 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 | |
setlocal enabledelayedexpansion | |
set "string=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | |
set "result=" | |
for /L %%i in (1,1,64) do call :add | |
echo %result% | |
goto :eof | |
:add | |
set /a x=%random% %% 62 | |
set result=%result%!string:~%x%,1! | |
goto :eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment