Introduction: Batch Account Creator and Login With Hidden Password

Here is a batch account creator and login program I made for my first instructable. This is a partly simplified version of Prof. pickle's Hidden Password instructable. Please leave any suggestions or ideas of what else I could do an instructable on or what other programs I could make in batch.

Step 1: The Code

@echo off
title Password Protection
set hidden=
set password=
goto menu
:menu
cls
echo Would you like to create an account or login?
echo.
echo 1. Create
echo 2. Login
echo.
set /p input3=Number:
if %input3% == 1 goto create
if %input3% == 2 goto login
:create
cls
echo Choose a username.
set /p input4=Username:
IF EXIST %input4%.bat echo That username is already in use && pause && goto create
cls
echo Choose a password.
set /p input5=Password:
echo set pw=%input5% >>%input4%.bat
goto menu
:dots
set password=%password%%letter%
set hidden=%hidden%.
goto login1
:login
cls
set /p input1=Username:
IF NOT EXIST %input1%.bat echo That username does not exist? && pause && goto login
call %input1%.bat
goto login1
:login1
if %pw% == %password% goto yes
cls
echo Username:%input1%
echo Password:%hidden%
choice /c abcdefghijklmnopqrstuvwxyz123456789 /n
if %errorlevel% equ 1 set letter=a
if %errorlevel% equ 2 set letter=b
if %errorlevel% equ 3 set letter=c
if %errorlevel% equ 4 set letter=d
if %errorlevel% equ 5 set letter=e
if %errorlevel% equ 6 set letter=f
if %errorlevel% equ 7 set letter=g
if %errorlevel% equ 8 set letter=h
if %errorlevel% equ 9 set letter=i
if %errorlevel% equ 10 set letter=j
if %errorlevel% equ 11 set letter=k
if %errorlevel% equ 12 set letter=l
if %errorlevel% equ 13 set letter=m
if %errorlevel% equ 14 set letter=n
if %errorlevel% equ 15 set letter=o
if %errorlevel% equ 16 set letter=p
if %errorlevel% equ 17 set letter=q
if %errorlevel% equ 18 set letter=r
if %errorlevel% equ 19 set letter=s
if %errorlevel% equ 20 set letter=t
if %errorlevel% equ 21 set letter=u
if %errorlevel% equ 22 set letter=v
if %errorlevel% equ 23 set letter=w
if %errorlevel% equ 24 set letter=x
if %errorlevel% equ 25 set letter=y
if %errorlevel% equ 26 set letter=z
if %errorlevel% equ 27 set letter=1
if %errorlevel% equ 28 set letter=2
if %errorlevel% equ 29 set letter=3
if %errorlevel% equ 30 set letter=4
if %errorlevel% equ 31 set letter=5
if %errorlevel% equ 32 set letter=6
if %errorlevel% equ 33 set letter=7
if %errorlevel% equ 36 set letter=8
if %errorlevel% equ 35 set letter=9
if %errorlevel% equ 36 set letter=0
if %errorlevel% equ 37 goto check
goto dots
:yes
cls
echo That password is correct!
pause exit

Step 2: Tidy Things Up a Bit

If you find your desktop is getting cluttered with .bat files, you can change part of the code so that all of the accounts made are put into a nice little folder. Below is the code...

echo set pw=%input5% >>%input4%.bat

change to...

echo set pw=%input5% >>folder/%input4%.bat

but change "folder" to the folder name of your choice.

Comments

About This Instructable

1,302views

10favorites

License:

More by Gwalin:Batch Game: DodgemsBatch Game: Slide PuzzleBatch Number Organiser
Add instructable to: