| 1. |
Solve : Batch save info to config.ini and read info from config.ini / Login and register? |
|
Answer» Hello im try to make a log in and register batch file. You type register and it goes to the register page and you enter info that saves to config.ini. You type LOGIN and you type your info that saved to the config.ini if its not matching the config.ini it will give you an error. So far this is what i have and i NEED help finishing it. So if you can help me with the error stuff and loading the info from config.ini for logging in that would be awesome. Thanks It looks like what you are doing is called a 'spoof' and u want to confuse a novice user to revealing a password.That's not what I'm doing. It would be PRETTY stupid if i did that.v2 Code: [Select]@echo off title Database color 0a if exist user goto menu if not exist user ( md data\user goto menu ) :menu cls set a=0 echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88B 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. echo 1) Login echo 2) Create Account echo 3) Delete Account echo. echo. set /p a= ) if %a%==1 goto login if %a%==2 goto create if %a%==3 goto delete if %a%==exit goto exit goto menu :login cls echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. set b=0 echo. echo Account Name echo. set /p b=) if exist data\user\%b% goto password if not exist data\user\%b% goto wrongname :delete cls set a=0 echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. echo Type the name of the user you want to delete. echo. echo. dir /s user pause goto menu :wrongname cls echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. echo Account not found. echo. echo Press any key to go back to the main menu. pause >nul goto menu :password set c=0 cls echo Password: set /p c=: %c%>>data\%b%\config.ini if exist user\data\%b%\config.ini %c% goto online if not exist user\data\%b%\config.ini %c% goto wrongpassword :wrongpassword cls echo Password does not match account. pause goto password :create cls echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. echo New Account Name echo. set /p d=: if exist user\%d% goto exist if not exist user\%d% ( md user\%d% goto newpass ) :exist cls echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. echo That account name already exist pause goto create :newpass cls echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. echo New Password echo. set /p e=: md user\%d%\%e% cls echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. echo Account Name: %d% echo Password: %e% echo. pause goto yes :yes cls echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. start data\comp ping localhost -n 4 >nul taskkill /f /im wscript.exe goto online :no goto create :exit exit :online cls echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. start data\in ping localhost -n 2 >nul taskkill /f /im wscript.exe >nul exitQuote from: DaftHacker on May 28, 2012, 04:13:32 PM echo. Why do you repeat this code over and over? make a subroutine and call it call :showbanner like this Code: [Select]@echo off title Database color 0a if exist user goto menu if not exist user ( md data\user goto menu ) :menu cls set a=0 call :showbanner echo 1) Login echo 2) Create Account echo 3) Delete Account echo. echo. set /p a= ) if %a%==1 goto login if %a%==2 goto create if %a%==3 goto delete if %a%==exit goto exit goto menu :login cls call :showbanner set b=0 echo. echo Account Name echo. set /p b=) if exist data\user\%b% goto password if not exist data\user\%b% goto wrongname :delete cls set a=0 call :showbanner echo Type the name of the user you want to delete. echo. echo. dir /s user pause goto menu :wrongname cls call :showbanner echo Account not found. echo. echo Press any key to go back to the main menu. pause >nul goto menu :password set c=0 cls echo Password: set /p c=: %c%>>data\%b%\config.ini if exist user\data\%b%\config.ini %c% goto online if not exist user\data\%b%\config.ini %c% goto wrongpassword :wrongpassword cls echo Password does not match account. pause goto password :create cls call :showbanner echo New Account Name echo. set /p d=: if exist user\%d% goto exist if not exist user\%d% ( md user\%d% goto newpass ) :exist cls call :showbanner echo That account name already exist pause goto create :newpass cls call :showbanner echo New Password echo. set /p e=: md user\%d%\%e% cls call :showbanner echo Account Name: %d% echo Password: %e% echo. pause goto yes :yes cls call :showbanner start data\comp ping localhost -n 4 >nul taskkill /f /im wscript.exe goto online :no goto create :exit exit :online cls call :showbanner start data\in ping localhost -n 2 >nul taskkill /f /im wscript.exe >nul exit :showbanner echo. echo 8888888b. 888 888 echo 888 "Y88b 888 888 echo 888 888 888 888 echo 888 888 8888b. 888888 8888b. 88888b. 8888b. .d8888b .d88b. echo 888 888 "88b 888 "88b 888 "88b "88b 88K d8P Y8b echo 888 888 .d888888 888 .d888888 888 888 .d888888 "Y8888b. 88888888 echo 888 .d88P 888 888 Y88b. 888 888 888 d88P 888 888 X88 Y8b. echo 8888888P" "Y888888 "Y888 "Y888888 88888P" "Y888888 88888P' "Y8888 echo. echo. goto :eof |
|