I have a file called name-code.bat
that I'm using as a username and password for this code. But the batch file outputs always that this file is missing.
I have tried moving name-code.bat
out of the profiles folder and back in and all around, but it still ends with the else
command.
@echo off
color 0a
cls
goto login-menu
:badlogin
cls
echo error that is not an available option
:login-menu
echo please input a # then press enter
echo --------------------------------------
echo.
echo 1 - sign in
echo 2 - sign up
echo 3 - exit
echo.
set /p log1=:
if %log1%==1 goto login
if %log1%==2 goto sign up
if %log1%==3 exit
goto badlogin
:sign up
cls
echo --------SIGN UP--------
echo.
set /p username= Enter a username:
set /p password= Enter a password:
(
@echo off
echo username: %username%
echo password: %password%
) > c:\users\Blaine\Desktop\profiles\%username%-%password%.bat
cls
goto login-menu
:login
cls
echo --------SIGN IN-------
echo.
set /p username= Username:
set /p password= Password:
if exist users\Blaine\Desktop\profiles\%username%-%password% (
echo %username%-%password%.bat has been found
) ELSE (
echo %username%-%password%.bat is missing
)
pause
I want it to output name-code.bat has been found
, but it always results in execution of else
branch with printing name-code.bat is missing
to console.