So I am trying to make a log in system for my batch files. I have it to where it creates the text document and puts the info in it, I just don’t know how do make it so if you type in an unregistered name (name in the text file) or password wrong, it will tell you. Here is my script if think you can help me.
@echo off
title login
color 0b
:menu
cls
echo 1.Sign in
echo 2.Register
echo 4.Exit
echo.
set /p input=What would you like to do:
if %input%==1 goto log
if %input%==2 goto reg
if %input%==3 goto exit
goto error
:reg
cls
color 0e
set /p user=Enter your desired username:
set /p pass=Enter your desired password:
echo %user% >> username.txt
echo %pass% >> password.txt
:log
if exist username.txt goto menu2
if not exist password.txt goto reg
goto error
:menu2
cls
color 0b
echo WELCOME!
echo.
echo 1.Sign in
echo 2.Options
echo 3.Exit
echo.
set /p input=What would you like to do?
if %input%==1 goto log2
if %input%==2 goto op
if %input%==3 goto exit
goto error
:exit
exit
:log2
cls
color 0b
set /p input=Username:
if exist goto pass2
goto error
This is an example, add bits of it to urs.
@echo off
set INV=type ur password below
:home
cls
echo %INV%
set /p “input=plz enter here>”
if %input%==ENTERURPASSWORDHERE goto hi
If NOT %input%==ENTERURPASSWORDHERE set INV=INCORRECT && goto home
:hi
color a
cls
echo u are now logged in
Pause>nul