Save to a log file.
Posted: 09 Apr 2012 13:46
Hi, i need help with this code. I want it to save the password and the username in the same log.
i have tried every thing XD
:Reg
Title Register
Echo REGISTERATION
Echo:
set /p U=Username:
set /p P=Password:
Echo %P%>password.log
Echo %U%>username.log
Echo Registeration Complete!
Echo Press any key
Pause>nul
:Login
cls
setlocal
set User2=
for /f "tokens=*" %%a in ('type username.log 2^>NUL') do set User2=%%a
set Pass2=
for /f "tokens=*" %%a in ('type password.log 2^>NUL') do set Pass2=%%a
:Loginp2
Title Log in
cls
Echo Log in
Echo:
set /p user= Username:
set /p pass= Password:
if /i %user% equ %User2% (
if /i %pass% equ %Pass2% (
goto W
)
) else (goto IC)
:IC
cls
echo The Password/Username was incorrect please try again
Echo:
Echo press any key
i have tried every thing XD
:Reg
Title Register
Echo REGISTERATION
Echo:
set /p U=Username:
set /p P=Password:
Echo %P%>password.log
Echo %U%>username.log
Echo Registeration Complete!
Echo Press any key
Pause>nul
:Login
cls
setlocal
set User2=
for /f "tokens=*" %%a in ('type username.log 2^>NUL') do set User2=%%a
set Pass2=
for /f "tokens=*" %%a in ('type password.log 2^>NUL') do set Pass2=%%a
:Loginp2
Title Log in
cls
Echo Log in
Echo:
set /p user= Username:
set /p pass= Password:
if /i %user% equ %User2% (
if /i %pass% equ %Pass2% (
goto W
)
) else (goto IC)
:IC
cls
echo The Password/Username was incorrect please try again
Echo:
Echo press any key