Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Batch Login Script


ghost's Avatar
0 0
Ya ive been going thru tutorials for batch and i wanted to make a login script that closes the program if you try to login incorrectly more than 3x. Here's the code:```markup@echo off
set user=end3r
set pass=12345
set /p username=Enter username:
set /p password=Enter password:
set /a amount=0
GOTO User
User echo %username% if %username% equ %user% echo %password% GOTO Pass
Pass echo %password% if %password% equ %pass% echo Welcome… GOTO Incorrect
Incorrect echo The username, and or password you specified was incorrect. GOTO User and umm how come it keeps on looping? Also i have no idea really how to make it exit after 3 tries would it be something like:markupset /a Tries=%Try%+1 if %Tries% equ 3 GOTO END
END exit```because when i did that and i did set a Try variable, but its not included in the first piece of code, it looped 3 times and then quit. Thanks end3r

ghost's Avatar
0 0

thanks, no i didn't end3r