Make a batch login/register system? Code to it? -
i trying make advanced batch-file has role of simple login system, means can register in batch file, , data exported batch file, under variables, , when login, file variables called, setting password can login, , other stuff. in 1 batch file passwords in external files. tried code this, , works until step have write password login: when enter password (for example it's "nekav") (i sure correct when input) batch file writes "nekav unexpected/unattended" , closes.
p.s.: save password under variable in file, used:echo set pass1=pass1a (pass1a input password, registration)
unable find error in code, have uploaded here: http://pastebin.com/rlffpsqg
can please tell me, error?
i'm decently proud of :) has 2 different files: login.bat handles login , login2.bat handles registration. login.bat:
@echo off choice /c:rl /m "choose option: register (r) or login (l).: if errorlevel 2 goto login if errorlevel 1 goto register :register start /wait c:\[path]\login2.bat cls goto login :in cls echo welcome %u% echo. echo bla bla bla or start "a program" pause exit :login set /p u=username set /p p=password and login2.bat:
@echo off :a set /p a="choose username" set /p b="choose password" echo. choice /m "are sure username %a% , password %b%?" if errorlevel 2 goto set q="if %%u%% equ %a% if %%p%% equ %b% goto in" /f "tokens=*" %%i in (%q%) set m=%%i echo %m% >>c:\[path]\login.bat exit the reason why :in, label handles happens after login has in middle instead of @ end of login.bat username/password combinations appended :login label. add other embellishments , change name of files, basic design. hope helps!
Comments
Post a Comment