Advertisement
D3nX

Advanced Batch OS Speedcoding

Nov 16th, 2016
1,349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.63 KB | None | 0 0
  1. @echo off
  2. title Batch OS - Speedcoding
  3. mode con: lines=25 cols=75
  4.  
  5. :boot
  6. cls
  7. color 0a
  8. echo Batch OS - Speedcoding booting up...
  9. timeout /t 3 /nobreak >nul
  10.  
  11. :verify_logon
  12. if exist log.txt goto :logon
  13. if not exist log.txt goto :make_logon
  14.  
  15. :logon
  16. <log.txt (
  17. set /p username=
  18. set /p password=
  19. )
  20. cls
  21. echo Please type your username and your password.
  22. echo.
  23. set /p user=Username :
  24. if not %user% == %username% goto :logon
  25. echo.
  26. set /p pass=Password :
  27. if %pass% == %password% goto :desktop
  28. goto :logon
  29.  
  30. :make_logon
  31. cls
  32. echo Please set your new username/password.
  33. echo.
  34. set /p user=Username :
  35. echo.
  36. set /p pass=Password :
  37. (
  38. echo %user%
  39. echo %pass%
  40. ) >log.txt
  41. goto :logon
  42.  
  43. :desktop
  44. cls
  45. color 0a
  46. ::Hide cursor
  47. batbox /h 0
  48. ::Up line and Down line
  49. for /l %%a in (1,1,73) do (
  50. batbox /g %%a 0 /c 0xaa /d "0"
  51. batbox /g %%a 24 /c 0xaa /d "0"
  52. )
  53. ::Draw a start button
  54. for /l %%a in (1,1,7) do (
  55. batbox /g %%a 24 /c 0x11 /d "0"
  56. )
  57. batbox /g 2 24 /c 0x10 /d "Start"
  58. ::Draw the time
  59. batbox /g 63 0 /c 0xA0 /d "%time%"
  60.  
  61. ::go to the clic funtion
  62. goto :clic_desk
  63.  
  64. :clic_desk
  65. for /f "tokens=1,2,3 delims=:" %%a in ('batbox /m') do (
  66. set X=%%a
  67. set Y=%%b
  68. set C=%%c
  69. )
  70.  
  71. ::verify if user clicked on start
  72. for /l %%a in (1,1,7) do (
  73.     if %X% == %%a if %Y% == 24 goto :start
  74. )
  75.  
  76. goto :clic_desk
  77.  
  78. :start
  79. ::draw the menu
  80. for /l %%a in (23,-1,13) do (
  81. batbox /g 1 %%a /c 0x11 /d "000000000000"
  82. )
  83. ::draw the title of the menu
  84. batbox /g 5 13 /c 0xC1 /d "MENU"
  85. ::draw some option
  86. batbox /g 1 14 /c 0x10 /d "About..."
  87. batbox /g 1 15 /c 0x10 /d "Restart"
  88. batbox /g 1 16 /c 0x10 /d "Exit"
  89. ::go to click function for start menu
  90. goto :clic_start
  91.  
  92. :clic_start
  93. for /f "tokens=1,2,3 delims=:" %%a in ('batbox /m') do (
  94. set X=%%a
  95. set Y=%%b
  96. set C=%%c
  97. )
  98.  
  99. ::verify if user clicked on start a new time
  100. for /l %%a in (1,1,7) do (
  101.     if %X% == %%a if %Y% == 24 goto :desktop
  102. )
  103.  
  104. ::verify if user clicked on about
  105. for /l %%a in (1,1,7) do (
  106.     if %X% == %%a if %Y% == 14 goto :about
  107. )
  108.  
  109. ::verify if user clicked on restart
  110. for /l %%a in (1,1,7) do (
  111.     if %X% == %%a if %Y% == 15 goto :boot
  112. )
  113.  
  114. ::verify if user clicked on exit
  115. for /l %%a in (1,1,7) do (
  116.     if %X% == %%a if %Y% == 16 exit
  117. )
  118.  
  119. goto :clic_start
  120.  
  121. :about
  122. cls
  123. color 0a
  124. ::Up line and Down line
  125. for /l %%a in (1,1,73) do (
  126. batbox /g %%a 0 /c 0xaa /d "0"
  127. batbox /g %%a 24 /c 0xaa /d "0"
  128. )
  129. ::Draw text
  130. batbox /g 1 2 /c 0x0a /d "Batch OS - SpeedCoding"
  131. batbox /g 1 3 /c 0x0a /d "By D3nX"
  132. batbox /g 1 4 /c 0x0a /d "A fully open source Batch OS"
  133. batbox /g 1 5 /c 0x0a /d "Version : 1.0"
  134. batbox /g 1 7 /c 0x0a /d "Press a key to return desktop..."
  135. pause >Nul
  136. goto :desktop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement