loading

This isntsructable will show you an alternative method of adding a username and password to a batch file. I have not seen very many people use this method before, I learned it when I lost my internet for a while and did allot of playing around with stuff.

I also included bat to exe converter for those of you that are like me out there, lol

Step 1: This Is the Code

@ECHO OFF
TITLE Login Script
COLOR 0a
:USERID
CLS
ECHO Enter User ID:
ECHO > NUL
SET /p USERID=
IF %USERID% EQU Eastern.Dragon GOTO PASSWORD
IF %USERID% LSS Eastern.Dragon GOTO INVALID
IF %USERID% GTR Eastern.Dragon GOTO INVALID
:PASSWORD
CLS
ECHO Enter autherization code:
SET /p PASSWORD=
IF %PASSWORD% EQU Nemraiku22159 GOTO MAIN
IF %PASSWORD% LSS Nemraiku22159 GOTO INVALID
IF %PASSWORD% GTR Nemraiku22159 GOTO INVALID
:INVALID
CLS
ECHO INAVLID LOGIN.....
PING -n 3 127.0.0.1 > NUL
ECHO Please try again...
PING -n 3 127.0.0.1 > NUL
GOTO USERID
:MAIN
ECHO Welcome Nemraiku...
PING -n 3 127.0.0.1 > NUL



You will need to replace Eastern.Dragon with your own personnel username and replace Nemraiku22159 with you own password.
<p>Whats equ lss and gtr for</p>
Thank you very much
No problem, got tired of everyone else's methods
Is there a way to hide the password when your typing it in?
Yes, yes there is. I have an instructable on it but you I'm sure you can also implement the FINDSTR command to do it too.
I think so, let me do some looking around after I get outta school, but I gotta get off here for now
where can i put my password?
How do you apply this to a folder?<br>
You could create a shortcut to a this batch file and then hide the folder (right-click -&gt; Properties -&gt; hiden) and then make the batch file open the selected folder <br>If %PASSWORD% EQU Nemraiku22159 start FOLDERPATH HERE <br> <br>That should hopefully work...
How do u make multiple users
Easy, you just add different possible correct usernames and corresponding passwords. E.g Heres my (tweaked) code: <br> <br>@echo off <br>Title Login Script <br>:USERID <br>color 0a <br>cls <br>echo Enter UserID <br>echo. <br>set /p userid= <br>If %userid% EQU USERNAME#1 goto user1 <br>If %userid% EQU USERNAME#2 goto user2 <br>If %userid% EQU USERNAME#3 goto user3 <br>goto incorrect1 <br>:user1 <br>cls <br>echo Enter Password <br>echo. <br>set /p pass1= <br>If %pass1% NEQ PASSWORD#1 goto incorrect2 <br>goto account1 <br>:user2 <br>cls <br>echo Enter Password <br>echo. <br>set /p pass2= <br>If %pass2% NEQ PASSWORD#2 goto incorrect2 <br>goto account2 <br>:user3 <br>cls <br>echo Enter Password <br>echo. <br>set /p pass3= <br>If %pass3% NEQ PASSWORD#3 goto incorrect2 <br>goto account3 <br>:account1 <br>cls <br>echo Welcome %userid% <br>::CONTINUE ON FROM HERE <br>pause <br>:account2 <br>cls <br>echo Welcome %userid% <br>::CONTINUE ON FROM HERE <br>pause <br>:account3 <br>echo Welcome %userid% <br>::CONTINUE ON FROM HERE <br>pause <br>:incorrect1 <br>cls <br>color 04 <br>echo Wrong Username! <br>ping localhost -n 5 &gt;nul <br>goto USERID <br>:incorrect2 <br>cls <br>color 04 <br>echo Wrong Password <br>ping localhost -n 5 &gt;nul <br>goto USERID

About This Instructable

8,645views

6favorites

License:

More by Nemraiku:Different method of adding password to batch file Batch file to crash a computer How to make a batch file that file shutdown a computer every half hour of every day 
Add instructable to: