Different Method of Adding Password to Batch File

8,884

6

11

Posted

Introduction: Different Method of Adding Password to Batch File


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.

Share

    Recommendations

    • Science of Cooking

      Science of Cooking
    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Microcontroller Contest

      Microcontroller Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    11 Comments

    Whats equ lss and gtr for

    user

    Thank you very much

    No problem, got tired of everyone else's methods

    user

    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?

    You could create a shortcut to a this batch file and then hide the folder (right-click -> Properties -> hiden) and then make the batch file open the selected folder
    If %PASSWORD% EQU Nemraiku22159 start FOLDERPATH HERE

    That should hopefully work...

    How do u make multiple users