Introduction: Batch File Password Protection

Original Code by Rolf Locher (The first one)

Hello instructables community! I have decided to share with you one of the simplest ways to make a secondary login screen with a batch file. It is designed to make a login screen for programs, files, and anything else you want to protect. If you know a little about computers, you can apply this program to any operation. This is my very first instructable so please go easy on the comments. 

Step 1: Creating the File

OK, so the first thing you will want to do is download the text document at the end of this step.
You want to save this as scrnlock.bat
Make sure you change the file type to all files or it will save as a text document.
In the beginning of the script, there is a line that says Color C. You can change the colors by using different combinations of letters and numbers. The first number will control the background color, the second will control the text color. 
EX: Color C1 would be a light red background and blue text.
type color help in CMD for a complete list of colors.

Step 2: Another Way

Another way to create a screen lock is this. Same thing with filling in the things in parentheses. This runs the taskill command wich basically shuts off explorer.exe. there is a simple way to get out of this. Ctrl - Alt - Delete. goto task manager. goto new task. goto run. now run explorer.exe. But still, this is a pretty cool thing to play around with.

@ Echo off
color 02
Taskkill -f -im explorer.exe
Title Welcome (Your Name)
set tries=(how ever many tries you want to have)
:top
cls
set /a tries=%tries% -1
if %tries%==0 (
goto penalty
)
Echo You have %tries% attempts left.
Echo Please enter the password to proceed
set /p password=
if %password%==(Enter Password Here) (
echo Welcome (Your Name)
If %password% EQU (Your Password) START explorer.exe
ping localhost -n 5 >nul
cls
Echo CONNECTED!
pause
cls
) else (
goto top
)
goto top
:penalty
echo A
ping localhost -n .15 >nul
cls
echo Ah
ping localhost -n .15 >nul
cls
echo Ah A
ping localhost -n .15 >nul
cls
echo Ah Ah
ping localhost -n .15 >nul
cls
echo Ah Ah A
ping localhost -n .15 >nul
cls
echo Ah Ah Ah
ping localhost -n .15 >nul
cls
echo Ah Ah Ah,
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, Y
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, Yo
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You D
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Di
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Did
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn'
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't S
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Sa
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say T
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say Th
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The M
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Ma
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Mag
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magi
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic W
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Wo
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Wor
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Word
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Word.
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Word..
ping localhost -n .15 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Word...
ping localhost -n 5 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Word...
ping localhost -n 5 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Word...
ping localhost -n 5 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Word...
ping localhost -n 5 >nul
cls
echo Ah Ah Ah, You Didn't Say The Magic Word...
ping localhost -n 5 >nul
cls
echo "Next Time, Just Ask Me For The Magic Word"
shutdown.exe -s -f  

Step 3: Finished!

 All done!!
Note: You have to fill in the sections that say (your name here) with your name, of course, and the sections that say (your password here) with your password of choice.
please comment and rate.