Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- Echo. > Temp.txt
- :: You require choice.exe for this
- choice /c 1234567890qwertyuiopasdfghjklzxcvbnm
- Echo 1 > Temp.txt
- @echo off
- set var=
- :: Code Prior to Loop
- :: Loop starts below
- start /b stroke.bat
- :loop
- ::: Loop Code Goes here
- ::
- :: You will not be able to take user-input in loop
- :: Do not tamper with "var"
- :: To force exit the loop just "goto end"
- :: Note if you force exit the loop you will need to exit this bat
- :: and start a new window (since Stroke will be running)
- ::
- ::: End of loop
- <Temp.txt set /p var=
- if "%var%" NEQ "1" goto loop
- :end
- :: Post loop code
- Exit
- @echo off
- Echo. > Temp.txt
- set /p v=
- Echo 1 > Temp.txt
- :start
- @echo off
- cls
- :loop1
- cls
- echo press 1 for option 1
- echo press 2 for option 2
- echo press 3 for option 3
- echo press any other number key to tell the date
- echo.
- echo %time%
- choice /t 1 /c 123456789q /d q >nul
- if %errorlevel% EQU 10 goto loop1
- if %errorlevel% EQU 1 goto 1
- if %errorlevel% EQU 2 goto 2
- if %errorlevel% EQU 3 goto 3
- if %errorlevel% GEQ 4 goto end
- goto loop1
- :1
- echo.
- echo.
- echo option 1
- echo.
- pause
- exit
- :2
- echo.
- echo.
- echo option 2
- echo.
- pause
- exit
- :3
- echo.
- echo.
- echo option 3
- echo.
- pause
- exit
- :end
- echo %date%
- pause
- Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement