Introduction: Password Generator With Batch
Hey Guys!
I created an awesome batch password generator.Totally batch here is the download and the code.
===================================================================================
@echo off
color 12
cls
echo.
echo Password Generator 3000 (Example)
echo.
echo Write first name.
echo.
set /p fname=
echo.
echo Write last name.
echo.
set /p lname=
echo.
echo Generating password......
echo.
pause
set password=%random%%fname%%random%%lname%%random%
cls
color 21
echo.
echo
%password%
echo.
echo Passwordgenerated!
echo.
pause
:verification
cls
echo.
echo Write password.
echo.
set /p p=
if %p% equ %password% goto correct
if %p% neq %password% goto wrong
:correct
color 12
cls
echo.
echo Password correct!
echo. echo
Your balance %random%.
echo.
pause
exit
:wrong
color 04
cls
echo.
echo Password wrong!
echo.
pause
exit
===============================================================================
Its a fair sized amount of code.In the next few steps i will tell you how i did it.
Attachments
Step 1: Step 1 of 2
In this step i will tell you how i made it happen.
I used the %random% command.
When ever you use this command in a batch file it generates
a random 4 or 5 digit number so i simply set the password to %random%%fname%%random%
%lname%%random%
to produce a random password.Some of you guys might be wondering what is lname and fname
fname stands for first name and lname stands for last name.I set this because not everybody using the password generator will have the same last name and also first name.
Step 2: Step 2 of 2
In this step i will tell you how i actually made it using strings.One of the most popular feature of batch is strings.
We can set any string like i did with set password=%random%.........
I used this almost everywhere in my password generator.
Like set /p name= and also set /p password=
The command that i used to indicate that the password was correct or wrong was the if command by writing
if %p% equ %password% goto correct and
if %p% neq %password% goto wrong
I hope you understood!
Thank you for reading!
6 Comments
6 years ago
Hello OzonerPlays, you said to comment what we want you to make next. How about helping me improve my artificial intelligence chatbot. It has 1,500 lines of code and is capable of verbally responding to user input. It is the instructable I have posted so far.
6 years ago
Mine is not working
6 years ago
Please tell me if there are any mistakes in this syntax i will do my best to correct them.
6 years ago
hello I love this please do Java then I will like every thing and follow ??????
Reply 6 years ago
Ok Ahmed.I will do java tutorials and also java script.
6 years ago
Please comment of what you want me to make next.