Advertisement
Guest User

Untitled

a guest
Oct 8th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. @echo off
  2. Echo. > Temp.txt
  3. :: You require choice.exe for this
  4. choice /c 1234567890qwertyuiopasdfghjklzxcvbnm
  5. Echo 1 > Temp.txt
  6.  
  7. @echo off
  8. set var=
  9. :: Code Prior to Loop
  10.  
  11.  
  12. :: Loop starts below
  13. start /b stroke.bat
  14. :loop
  15.  
  16. ::: Loop Code Goes here
  17. ::
  18. :: You will not be able to take user-input in loop
  19. :: Do not tamper with "var"
  20. :: To force exit the loop just "goto end"
  21. :: Note if you force exit the loop you will need to exit this bat
  22. :: and start a new window (since Stroke will be running)
  23. ::
  24. ::: End of loop
  25.  
  26. <Temp.txt set /p var=
  27. if "%var%" NEQ "1" goto loop
  28. :end
  29.  
  30. :: Post loop code
  31. Exit
  32.  
  33. @echo off
  34. Echo. > Temp.txt
  35. set /p v=
  36. Echo 1 > Temp.txt
  37.  
  38. :start
  39. @echo off
  40. cls
  41. :loop1
  42. cls
  43. echo press 1 for option 1
  44. echo press 2 for option 2
  45. echo press 3 for option 3
  46. echo press any other number key to tell the date
  47. echo.
  48. echo %time%
  49. choice /t 1 /c 123456789q /d q >nul
  50. if %errorlevel% EQU 10 goto loop1
  51. if %errorlevel% EQU 1 goto 1
  52. if %errorlevel% EQU 2 goto 2
  53. if %errorlevel% EQU 3 goto 3
  54. if %errorlevel% GEQ 4 goto end
  55. goto loop1
  56. :1
  57. echo.
  58. echo.
  59. echo option 1
  60. echo.
  61. pause
  62. exit
  63. :2
  64. echo.
  65. echo.
  66. echo option 2
  67. echo.
  68. pause
  69. exit
  70. :3
  71. echo.
  72. echo.
  73. echo option 3
  74. echo.
  75. pause
  76. exit
  77. :end
  78. echo %date%
  79. pause
  80. Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement