Can someone explain what I am doing wrong here..?
As soon as I run the program it opens and closes immediately :/
It worked fine until I added the "if exist" shit, so presumably the syntax in there is fucked. I've never really used the "if" statement, so please take it easy on me :)
As soon as I run the program it opens and closes immediately :/
It worked fine until I added the "if exist" shit, so presumably the syntax in there is fucked. I've never really used the "if" statement, so please take it easy on me :)
Code
@echo off
:CreateDataBase
if exist "C:\Documents and Settings\Admin\database.txt"
(
goto Start
)
echo DATABASE SUCCESSFULLY CREATED >database.txt
:Start
set /p account=Do you have an account?
if %account%==yes goto Login
if %account%==no goto Create
:Create
cls
set /p newusername=Please enter your new username:
findstr /m "%newusername%" database.txt
if %errorlevel%==0
(
goto NameInUse
)
goto NewPass
:NameInUse
echo Error... Username is already taken! Please try again.
pause>nul
goto Create
:NewPass
set /p newpass=Please choose a password:
echo %newusername%--%newpass% >>database.txt
echo Account Created! Please Login.
pause>nul
goto Login

