Different Method of Adding Password to Batch File

Published

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

    • Clocks Contest

      Clocks Contest
    • Oil Contest

      Oil Contest
    • Water Contest

      Water Contest

    11 Discussions

    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

    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...

    Easy, you just add different possible correct usernames and corresponding passwords. E.g Heres my (tweaked) code:

    @echo off
    Title Login Script
    :USERID
    color 0a
    cls
    echo Enter UserID
    echo.
    set /p userid=
    If %userid% EQU USERNAME#1 goto user1
    If %userid% EQU USERNAME#2 goto user2
    If %userid% EQU USERNAME#3 goto user3
    goto incorrect1
    :user1
    cls
    echo Enter Password
    echo.
    set /p pass1=
    If %pass1% NEQ PASSWORD#1 goto incorrect2
    goto account1
    :user2
    cls
    echo Enter Password
    echo.
    set /p pass2=
    If %pass2% NEQ PASSWORD#2 goto incorrect2
    goto account2
    :user3
    cls
    echo Enter Password
    echo.
    set /p pass3=
    If %pass3% NEQ PASSWORD#3 goto incorrect2
    goto account3
    :account1
    cls
    echo Welcome %userid%
    ::CONTINUE ON FROM HERE
    pause
    :account2
    cls
    echo Welcome %userid%
    ::CONTINUE ON FROM HERE
    pause
    :account3
    echo Welcome %userid%
    ::CONTINUE ON FROM HERE
    pause
    :incorrect1
    cls
    color 04
    echo Wrong Username!
    ping localhost -n 5 >nul
    goto USERID
    :incorrect2
    cls
    color 04
    echo Wrong Password
    ping localhost -n 5 >nul
    goto USERID