An official Batch Programming blog! To Solve the daily problems with windows and fixing them with little notepad scripts. Unlock the Hidden Secrets of Windows, Learn to crack Software via CMD & Make your own Programming tools. Understand to Manipulate your PC via CMD.

Random Password Generator | By Kvc [on Request]

Random Password Generator: We Decided to make this simple batch program, only on the request of a user who asks us to make a program , that can generate random passwords or strings.

we don’t know, why he needed such kind of Program, but if someone need it , that means it has a place in this universe and maybe, someone else can learn from it or use it in their own alternative programs. 

Preview

random password generator:

The program name itself tells about the working of it. As this is gonna be used for generating random strings or passwords as in this case.

Then you can use this password to either place a random password in a login system. or to make a system more secure by changing its password every 20 mins.

And only admin known where the Password file resides in the system. whenever he wants to login. He just need to read that file and put the password residing inside the file to gain access on the system.

As in this kind of scenario, there is no static password that protects the system, It makes the system itself more secure. And breaking into such a system is not so easy task. So, without any delay lets take a look at the program itself.

About Program:

Generating random passwords is not a difficult task in batch Programming. All you need is just a single variable that has all possible items that a Password can have or we can generate password by repeating those items.

So, in this program I’m using Variable ‘String’ that contains all possible characters that a password can have thus by using The for loop ,we can easily generate Random passwords …

Also Read:  Circle Function v.1.0 | By Kvc

here, it is producing a random password, but if the algorithm is enhanced a bit, it can be used to generate a password in certain pattern and then it will be more advanced program.

REM Random Password generator: 
@echo off
cls
setlocal enabledelayedexpansion
title Random password generator by Kvc
set "string=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.,;:'"[{]}()-_+=*^&^%$#@!~`\^^by Kvc..."
REM "
:loop
set rnd[1]=!string:~%random:~1,2%,1!
set rnd[2]=!string:~%random:~0,1%,1!
set rnd[3]=!string:~%random:~1,2%,1!
set rnd[4]=!string:~%random:~0,2%,%random:~0,1%!
set rnd[5]=!string:~%random:~0,1%,1!
set rnd[6]=!string:~%random:~0,1%,%random:~0,1%!
set rnd[7]=!string:~%random:~0,2%,%random:~0,1%!
set rnd[8]=!string:~%random:~1,1%,1!
set rnd[9]=!string:~%random:~0,2%,%random:~0,1%!
set rnd[0]=!string:~%random:~2,1%,%random:~0,1%!
for /l %%a in (0,1,9) do (if /i "!rnd[%%a]!" == "" (goto loop))
set for_loop_repetition=%random:~0,1%
set password=
for /l %%a in (0,1,!for_loop_repetition!) do (
set "password=!password!!rnd[%%a]!"
)
echo. Password generated : !password!
pause >nul
goto loop

Keep learning, keep sharing…
Be happy, spread happiness…

thebateam

Next Post

Previous Post

Leave a Reply

© 2020 TheBATeam

Theme by Anders Norén