Password Generator With Batch

About: I am just a simple guy who wants to do many things and i will share those things with you.

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.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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!

1 Person Made This Project!

Recommendations

  • CNC Contest

    CNC Contest
  • Make it Move

    Make it Move
  • Teacher Contest

    Teacher Contest

6 Discussions

0
None
Hak3r213

2 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.

0
None
OzonerPlays

2 years ago

Please tell me if there are any mistakes in this syntax i will do my best to correct them.

0
None
AhmedT113

2 years ago

hello I love this please do Java then I will like every thing and follow ??????

1 reply
0
None
OzonerPlaysAhmedT113

Reply 2 years ago

Ok Ahmed.I will do java tutorials and also java script.

0
None
OzonerPlays

2 years ago

Please comment of what you want me to make next.