Me and my friend are bored, so we decided to do a bit of coding in BATCH and we made a basic login script. Basically, when you enter "Jack" as the user, it asks for a password and if you enter "Pass", it says incorrect even though it shouldn't. The strange thing is if you type the incorrect password it says its correct.
Here is my code
@echo off
color 2
:A
cls
echo Welcome, Please Log In
set /p user=Please Enter A Username:
IF "%user%"=="Jack" (
set /p pass=Please Enter A Password:
IF "%pass%"=="Pass" (
goto :B
) ELSE (
echo Password Incorrect
ping 192.0.2.2 -n 1 -w 2000 > nul
goto :A
)
) ELSE (
echo Username Incorrect
ping 192.0.2.2 -n 1 -w 2000 > nul
goto :A
)
:B
cls
echo Hello %user%
:C
set /p cmd="%user%> "
if "%cmd%"=="exit" (
goto :EXIT
) ELSE (
echo Invalid Command.
goto :C
)
:EXIT
exit