Advertisement
ozakisama

OS - Login

Jan 21st, 2016
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.75 KB | None | 0 0
  1. :main
  2. @echo off
  3. cls
  4. color a
  5. TITLE Bautista Project
  6. mode CON: COLS=80 lines=20
  7. setlocal EnableDelayedExpansion
  8. @echo %date%
  9. @echo  _____________________________
  10. @echo ^|                             ^|
  11. @echo ^|   Authentication required   ^|
  12. @echo +_____________________________+
  13. @echo.
  14. set usr=
  15. set /p usr=Username:
  16. if not defined usr goto main
  17. set pwd=
  18. set /p pwd=Password:
  19. if not defined pwd goto failed
  20.  
  21. for /f "tokens=* delims=" %%a in (file.txt) do (
  22.     set _usr=!_pwd!
  23.     set _pwd=%%a
  24. )
  25.  
  26. if %usr%==!_usr! (
  27.     if %pwd%==!_pwd! (
  28.         goto success
  29.     ) else (
  30.         goto failed
  31.     )
  32. ) else (
  33.     goto failed
  34. )
  35.  
  36. :success
  37. echo.
  38. echo Access granted
  39. pause>nul
  40. call menu.bat
  41.  
  42.  
  43. :failed
  44. echo.
  45. echo Access denied
  46. pause>nul
  47. goto main
  48.  
  49. pause>nul
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement