Wait for Few Seconds before Executing a Command
Posted: 30 Jun 2012 22:47
I was building a menu for a usb and in this menu you choose an option, I was wondering how can i make the menu execute a command after a few seconds if it didn't take an option.
This is the code:
This is the code:
@echo off
cls
mode 70,25
color 09
:: This code is for the menu
:: second the code
:menu
SET "MSL=SET /P ".= "
SET "OSL=SET /P ".= "
SET "EL=end&echo."
echo.&echo.&echo.
%MSL%غححححححححححححححححححححححححححححححغ" <nul %EL%
%MSL%؛ ؛" <nul %EL%
%MSL%؛" <nul &call :C 0f " Main Menu" &echo ؛
%MSL%؛ ؛" <nul end&echo.
%MSL%غححححححححححححححححححححححححححححححغ" <nul %EL%&echo.&echo.
SET /P ".= " <nul &CALL :C 0e "Options" %EL%&echo.
%OSL%" <nul &CALL :C 07 " 1. Python" %EL%
%OSL%" <nul &CALL :C 07 " 2. Executor" %EL%
%OSL%" <nul &CALL :C 07 " 3. In-Deeb Notes" %EL%
%OSL%" <nul &CALL :C 07 " 4. Project Folder" %EL%&echo.&echo.
SET "Command="
SET /P "Command=Command > "
IF NOT DEFINED Command CLS&GOTO menu
IF %Command%==1 echo option 1 working
IF %Command%==2 echo option 2 working
IF %Command%==3 echo option 3 working
IF %Command%==4 echo option 4 working
CLS
GOTO menu
:: first the color code
:C
set /p " = " > "%~2" <nul
findstr /v /A:%1 /R "^$" "%~2" nul 2>nul
set /p ".=" <nul
if "%3" == "end" set /p ".= " <nul
del "%~2" >nul 2>nul
exit /b