Instructables
Picture of 5 Cool Batch Files
In This instructable you will get 5 codes for 5 useful batch things

- Password Generator
- Password Protected Command Prompt
- Website Crasher
- Website Pinger
- PC Cleanup Utilities
 
Remove these adsRemove these ads by Signing Up

Step 1: Password Generator

Picture of Password Generator

This Batch generates number only passwords. You can choose from 1, 5. or 10 passowrds to show...all random

Code:

@echo off
:Start2
cls
goto Start
:Start
title Password Generator
echo I will make you a new password.
echo Please write the password down somewhere in case you forget it.
echo ----------------------------------------­-----------------------
echo 1) 1 Random Password
echo 2) 5 Random Passwords
echo 3) 10 Random Passwords
echo Input your choice
set input=
set /p input= Choice:
if %input%==1 goto A if NOT goto Start2
if %input%==2 goto B if NOT goto Start2
if %input%==3 goto C if NOT goto Start2
:A
cls
echo Your password is %random%
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:Exit
exit
:B
cls
echo Your 5 passwords are %random%, %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:C
cls
echo Your 10 Passwords are %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
1-40 of 49Next »
KingstonG1 month ago

Much easier, shorter code is

@echo off

echo ====================================

echo Welcome to Batch Password Generator!

echo ====================================

echo Input how many Passwords you would like!

echo 1 = 1 password

echo 2 = 5 passwords

echo 3 = 10 passwords

set /p input=

if %input% == 1 goto 1

if %input% == 2 goto 2

if %input% == 3 goto 3

:1

echo %random% ok, this is your passwrod! Write it down to Remember it!

pause

:2

echo %random% %random% %random% %random% %random% Ok, these are your passwords! Write them down to remember them!

pause

:3

echo %random% %random% %random% %random% %random% %random% %random% %random% %random% %random% Ok, these are your passwords! Write them down to remember them!

pause

Yh that is an easier way KingstonG thanks for the advice
excelanto1 month ago

Thanks for your valuable posting.I have collect more than information from your website. It is really wonderful blog. please added more than tips. i'm working in <a href="http://www.excelanto.com/">content management In Chennai </a>.Here providing very low price CMS , responsive webdesign and ERP. you have any more than information kindly make me call this number 044-42127512 or send your mail info@excelanto.com.

I tryed the Web Site Crasher and it did not Crash the website

please help

thanks
radame (author)  tesladude1233 years ago
it takes a while...a doss atack is like 1 out of 10 chance that it will...luckly it does bcause I shut down a website for 3 hours...
Can you give me a good website to crash

Here crash this one www.computherm-fabo.rs

XiloPac radame7 months ago

It is properly pronounced "DOS" or Denial Of Service. Not doss.

xana radame3 years ago
i need a ip crasher version of this.

Sorry to tell you but you can't crash a website with a batch file

BrandonB22 months ago

you guys want a really helpful batch file? i've used this all the time, it makes a text file of all the files in whatever drive the file is in, the best part is it's extremely simple and easy to remember! and it saves the text file in the folder/drive you're in. if you have a bunch of stuff on your computer, it will take up more memory than you think.

dir/s %cd% >allfiles.txt

CodeMadness2 months ago

You can create real batch file menus when echoing these two characters:

Ü

Û

Here is an example of what I made. It's weird! Hope you get the idea:

code:

@echo off
mode 1000
color e3
cls

:a
echo ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
echo Û Û
echo Û Û Û ÜÜÜ Û Û
echo Û Û Û Û Û Û
echo Û ÛÜÜÜÛ Û Û Û
echo Û Û Û Û Û
echo Û Û Û ÜÛÜ Û Û
echo Û Û
echo Û Û
echo Û Û
echo Û Û
echo ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
echo ÛÛ
echo ÛÛ
echo ÛÛ
echo ÛÛ
echo ÛÛ
echo ÛÛ
echo ÛÛ
echo ÛÛ
echo ÛÛ
echo ÙÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÚ
pause >nul

excelanto3 months ago

Great posting, Really very useful sharing. I Am working in a <a href="www.excelanto.com">CMS In Chennai</a>.Here providing very low cost price, CMS and responsive webdesign. Just send your mail, this is mail id info@excelanto.com.Do You have Any Information Let me now.....044-42127512

what was the website you killed

www.vertiv.com

ojohnson32 years ago
One thing that might be useful, is encrypting the username and password file. Any one have ideas?

This is somewhat late, but you could convert the .bat file into a .exe file using a free .bat to .exe converter. That's how I keep the source code hidden. Anyone with at least basic computer knowledge will be able to figure out the passwords and usernames otherwise, whereas if you were to convert it to a .exe file, it would make it a much more difficult task for them.

You could replace letters with different ones, and then encrypt them when you get them from an external file. Should be easy.
Regulators8 months ago

this is cool, but i made my own batch file, that allow you to download file from internet, just like download manager. please visit this instructables

http://www.instructables.com/id/How-To-download-Fi...

thanks dude!

Decim81 year ago
if anyone needs me to crash a website please ask, this program will not do anything, but i have made my own.

If anyone would please crash my school website, fairmont.k12.mn.us that would be great. Or if you're in for more of a challenge you could crash skyward.com :P

hay send me an email if your still interested in the school site thing my email is ddogss196@gmail.com

ddogs196 Decim89 months ago

hay can you send me the commands for it cause i have to be connected to a server to crash the site and the server

Decim8 would you give out this version that "works"
testicleboy, you should never post this much crud on a forum page, it is completely unnecessary, put it in a file and upload it and then put the link!, on the page. Here, since you did anyways, i reduced your mountain and made some tweaks that i hope even you can follow simply. and it works BTW, Download it Here: http://www.2shared.com/file/KA4t9WIo/Loading.html , the download link is the small blue button at the bottom of the page it says download on it. GoodLuck :)
Hey everyone this is the Code_Master giving you an updated Pinger, i just took this guys pinger deleted all but like 3 lines and wala made it probably 340% better! ENJOY!
Download Link: http://www.2shared.com/file/EDw0o46c/Pinger.html
bdblock943 years ago
is there any way i could program this so that it crashes a set website as soon as it is opened?
Unfortunately, you can't instantly crash it. It does the equivalent of opening a thousand tabs of the website, and it can't do it instantly. If you want it to open IE, just do "start www.example.com" and that'll open it in your default browser.
MonkiMan1 year ago
you can just go to command prompt and type ping www.google.com (insert the website you need) much easer
Tetheu981 year ago
Made this one cause I think that instead of choosing how many you want, the number of digits it has. Seems a bit more useful.

@echo off
:Start
rem This will basically reset everything
cls
color 07
title Password Generator
echo I will make you a new password.
echo Please write the password down somewhere in case you forget it.
echo This may take a little while to generate.
echo -----------------------------------------------------------------
echo 1) 3 digits password
echo 2) 4 digits password
echo 3) 5 digits password
echo 4) 6 digits password
echo 5) Exit
set /p choice=
if %choice%==1 goto Three
if %choice%==2 goto Four
if %choice%==3 goto Five
if %choice%==4 goto Six
if %choice%==5 exit
:Wrong
echo %choice% is not valid.
echo Choose one of the options
echo above.
ping localhost -n >nul 3
goto Start
:Three
cls
set /a three=%random%
if /i %three% gtr 999 goto Three
if /i %three% lss 100 goto Three
goto Threeok
:Threeok
cls
echo. & echo.
echo Your 3 digits password is %three%
echo Press ENTER
pause>nul
goto Start
:Four
cls
set /a four=%random%
if /i %four% gtr 9999 goto Four
if /i %four% lss 1000 goto Four
goto Fourok
:Fourok
cls
echo. & echo.
echo Your 4 digits password is %four%.
echo Press ENTER
pause>nul
goto Start
:Five
cls
set /a five=%random%
if /i %five% gtr 99999 goto Five
if /i %five% lss 10000 goto Five
goto Fiveok
:Fiveok
cls
echo. & echo.
echo Your 5 digits password is %five%.
echo Press ENTER
pause>nul
goto Start
:Six
cls
echo Generating...
set /a six=%random%%random%
if /i %six% gtr 999999 goto Six
if /i %six% lss 100000 goto Six
goto Sixok
:Sixok
cls
echo. & echo.
echo Your 6 digits password is %six%.
echo Press ENTER
pause>nul
goto Start
You could shorten your code monumentally by incorporating modulo expressions to constrain the value of the random number.

Example:
set /a num=%random% %% 999

The above would generate a random number between 999 and 0. You can change the minimum number using this method:

set /a num=%random% %% 6 + 1

The above method could be used for a dice in games. It will generate a random number between 6 and 1 (1,2,3,4,5,6).

So, instead of adding all of those sections:

@echo off
setlocal enabledelayedexpansion

:top
cls
echo Welcome to the magical password maker!
echo It only makes passwords that are all numbers.
echo Maximum of 5 characters
echo Type in the amount of digits you want your password to be...
set /p len=
if %len% gtr 10 goto top
if %len% equ 1 set /a pass=%random% %% 10
if %len% equ 2 set /a pass=%random% %% 90 + 10
if %len% equ 3 set /a pass=%random% %% 990 + 100
if %len% equ 4 set /a pass=%random% %% 9990 + 1000
if %len% equ 5 set /a pass=%random% %% 99990 + 10000
cls
echo ...And your password is
echo.
echo %pass%
pause>nul
goto top

Although your idea has been used in many ways, such as Guess the Number games and what not.

Good effort, if you need any help, just ask.



Tetheu981 year ago
Sorry for the English mistakes. I'm Brazilian, English isn't my native language. :P
olijake2 years ago
In reply to "testicle boy":

I do not know if this is too late, but here is the code:
----------------
@echo off
color 09
for /L %%a in (0,1,99) do (
cls
echo loading %a%%
ping localhost -n 1 >nul
)
cls
echo loading 100%
ping localhost -n 2 >nul
testicleboy2 years ago
i know this is not with the subject but help me make this shorter :)
@echo off
color 09
echo loading 1 %
ping localhost -n 1 >nul
cls
echo loading 2 %
ping localhost -n 1 >nul
cls
echo loading 3 %
ping localhost -n 1 >nul
cls
echo loading 4 %
ping localhost -n 1 >nul
cls
echo loading 5 %
ping localhost -n 1 >nul
cls
echo loading 6 %
ping localhost -n 1 >nul
cls
echo loading 7 %
ping localhost -n 1 >nul
cls
echo loading 8 %
ping localhost -n 1 >nul
cls
echo loading 9 %
ping localhost -n 1 >nul
cls
echo loading 10 %
ping localhost -n 1 >nul
cls
echo loading 11 %
ping localhost -n 1 >nul
cls
echo loading 12 %
ping localhost -n 1 >nul
cls
echo loading 13 %
ping localhost -n 1 >nul
cls
echo loading 14 %
ping localhost -n 1 >nul
cls
echo loading 15 %
ping localhost -n 1 >nul
cls
echo loading 16 %
ping localhost -n 1 >nul
cls
echo loading 17 %
ping localhost -n 1 >nul
cls
echo loading 18 %
ping localhost -n 1 >nul
cls
echo loading 19 %
ping localhost -n 1 >nul
cls
echo loading 20 %
ping localhost -n 1 >nul
cls
echo loading 21 %
ping localhost -n 1 >nul
cls
echo loading 22 %
ping localhost -n 1 >nul
cls
echo loading 23 %
ping localhost -n 1 >nul
cls
echo loading 24 %
ping localhost -n 1 >nul
cls
echo loading 25 %
ping localhost -n 1 >nul
cls
echo loading 26 %
ping localhost -n 1 >nul
cls
echo loading 27 %
ping localhost -n 1 >nul
cls
echo loading 28 %
ping localhost -n 1 >nul
cls
echo loading 29 %
ping localhost -n 1 >nul
cls
echo loading 30 %
ping localhost -n 1 >nul
cls
echo loading 31 %
ping localhost -n 1 >nul
cls
echo loading 32 %
ping localhost -n 1 >nul
cls
echo loading 33 %
ping localhost -n 1 >nul
cls
echo loading 34 %
ping localhost -n 1 >nul
cls
echo loading 35 %
ping localhost -n 1 >nul
cls
echo loading 36 %
ping localhost -n 1 >nul
cls
echo loading 37 %
ping localhost -n 1 >nul
cls
echo loading 38 %
ping localhost -n 1 >nul
cls
echo loading 39 %
ping localhost -n 1 >nul
cls
echo loading 40 %
ping localhost -n 1 >nul
cls
echo loading 41 %
ping localhost -n 1 >nul
cls
echo loading 42 %
ping localhost -n 1 >nul
cls
echo loading 43 %
ping localhost -n 1 >nul
cls
echo loading 44 %
ping localhost -n 1 >nul
cls
echo loading 45 %
ping localhost -n 1 >nul
cls
echo loading 46 %
ping localhost -n 1 >nul
cls
echo loading 47 %
ping localhost -n 1 >nul
cls
echo loading 48 %
ping localhost -n 1 >nul
cls
echo loading 49 %
ping localhost -n 1 >nul
cls
echo loading 50 %
ping localhost -n 1 >nul
cls
echo loading 51 %
ping localhost -n 1 >nul
cls
echo loading 52 %
ping localhost -n 1 >nul
cls
echo loading 53 %
ping localhost -n 1 >nul
cls
echo loading 54 %
ping localhost -n 1 >nul
cls
echo loading 55 %
ping localhost -n 1 >nul
cls
echo loading 56 %
ping localhost -n 1 >nul
cls
echo loading 57 %
ping localhost -n 1 >nul
cls
echo loading 58 %
ping localhost -n 1 >nul
cls
echo loading 59 %
ping localhost -n 1 >nul
cls
echo loading 60 %
ping localhost -n 1 >nul
cls
echo loading 61 %
ping localhost -n 1 >nul
cls
echo loading 62 %
ping localhost -n 1 >nul
cls
echo loading 63 %
ping localhost -n 1 >nul
cls
echo loading 64 %
ping localhost -n 1 >nul
cls
echo loading 65 %
ping localhost -n 1 >nul
cls
echo loading 66 %
ping localhost -n 1 >nul
cls
echo loading 67 %
ping localhost -n 1 >nul
cls
echo loading 68 %
ping localhost -n 1 >nul
cls
echo loading 69 %
ping localhost -n 1 >nul
cls
echo loading 70 %
ping localhost -n 1 >nul
cls
echo loading 71 %
ping localhost -n 1 >nul
cls
echo loading 72 %
ping localhost -n 1 >nul
cls
echo loading 73 %
ping localhost -n 1 >nul
cls
echo loading 74 %
ping localhost -n 1 >nul
cls
echo loading 75 %
ping localhost -n 1 >nul
cls
echo loading 76 %
ping localhost -n 1 >nul
cls
echo loading 77 %
ping localhost -n 1 >nul
cls
echo loading 78 %
ping localhost -n 1 >nul
cls
echo loading 79 %
ping localhost -n 1 >nul
cls
echo loading 80 %
ping localhost -n 1 >nul
cls
echo loading 81 %
ping localhost -n 1 >nul
cls
echo loading 82 %
ping localhost -n 1 >nul
cls
echo loading 83 %
ping localhost -n 1 >nul
cls
echo loading 84 %
ping localhost -n 1 >nul
cls
echo loading 85 %
ping localhost -n 1 >nul
cls
echo loading 86 %
ping localhost -n 1 >nul
cls
echo loading 87 %
ping localhost -n 1 >nul
cls
echo loading 88 %
ping localhost -n 1 >nul
cls
echo loading 89 %
ping localhost -n 1 >nul
cls
echo loading 90 %
ping localhost -n 1 >nul
cls
echo loading 91 %
ping localhost -n 1 >nul
cls
echo loading 92 %
ping localhost -n 1 >nul
cls
echo loading 93 %
ping localhost -n 1 >nul
cls
echo loading 94 %
ping localhost -n 1 >nul
cls
echo loading 95 %
ping localhost -n 1 >nul
cls
echo loading 96 %
ping localhost -n 1 >nul
cls
echo loading 97 %
ping localhost -n 1 >nul
cls
echo loading 98 %
ping localhost -n 1 >nul
cls
echo loading 99 %
ping localhost -n 1 >nul
cls
echo loading 100 %
ping localhost -n 2 >nul
WOKANDWAL2 years ago
For the PASSWORD GENERATOR...
Try This Code (More Options)
@echo off
:Start2
cls
goto Start
:Start
title Password Generator
echo I will make you up to 10 new passwords.
echo Please write the password down somewhere in case you forget it.
echo -----------------------------------------------------------------
echo 1) 1 Random Password
echo 2) 2 Random Passwords
echo 3) 3 Random Passwords
echo 4) 4 Random Passwords
echo 5) 5 Random Passwords
echo 6) 6 Random Passwords
echo 7) 7 Random Passwords
echo 8) 8 Random Passwords
echo 9) 9 Random Passwords
echo 10) 10 Random Passwords
echo Input your choice:
set input=
set /p input= Choice:
if %input%==1 goto A if NOT goto Start2
if %input%==2 goto B if NOT goto Start2
if %input%==3 goto C if NOT goto Start2
if %input%==4 goto D if NOT goto Start2
if %input%==5 goto E if NOT goto Start2
if %input%==6 goto F if NOT goto Start2
if %input%==7 goto G if NOT goto Start2
if %input%==8 goto H if NOT goto Start2
if %input%==9 goto I if NOT goto Start2
if %input%==10 goto J if NOT goto Start2
:A
cls
echo Your password is %random%
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:Exit
exit
:B
cls
echo Your 2 passwords are %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:C
cls
echo Your 3 Passwords are %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:D
cls
echo Your 4 Passwords are %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:E
cls
echo Your 5 Passwords are %random%, %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:F
cls
echo Your 6 Passwords are %random%, %random%, %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:G
cls
echo Your 7 Passwords are %random%, %random%, %random%, %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:H
cls
echo Your 8 Passwords are %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:I
cls
echo Your 9 Passwords are %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
:J
cls
echo Your 10 Passwords are %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%, %random%.
echo Now choose what you want to do.
echo 1) Go back to the beginning
echo 2) Exit
set input=
set /p input= Choice:
if %input%==1 goto Start2 if NOT goto Start 2
if %input%==2 goto Exit if NOT goto Start 2
ojohnson32 years ago
Remember that you would need to copy the entire code, Paste into a text file and rename to ".bat" at the end.

It might be that you cannot see extensions of files in the OS.
Chad Baxter2 years ago
why not join the Batch Homies Group? Where you can post your batch related Instructables.
Does this code just have to be copied and pasted? Because it doesnt work for me
Did you save it as a .bat file?
ben35ben342 years ago
so cool
1-40 of 49Next »