Skip to content

Instantly share code, notes, and snippets.

@amitkeret
Created June 3, 2024 15:33
Show Gist options
  • Save amitkeret/c21963b847ce9676ff3e97dbf252ebc1 to your computer and use it in GitHub Desktop.
Save amitkeret/c21963b847ce9676ff3e97dbf252ebc1 to your computer and use it in GitHub Desktop.
Bash script to display menu (and submenus) with choices
@echo off
echo.
echo Starting Caffeine...
Start "" caffeine64.exe
timeout /3 5 >NUL 2>&1
echo Stopping unwanted processes...
taskkill /f /im process1.exe >NUL 2>&1
taskkill /f /im process2.exe >NUL 2>&1
timeout /t 3 >NUL 2>&1
:menu
cls
echo.
echo Menu:
echo 1. Program1 =^>
echo 2. Websites =^>
echo.
echo 9. LOG OFF
set /p choice=Enter your choice:
if "%choice%"=="1" goto prog1
if "%choice%"=="2" goto web
if "%choice%"=="9" goto exit
:prog1
echo.
echo Starting...
Start "" "C:\Program Files\some\program\path.exe"
timeout /t 5 >NUL 2>&1
goto menu
:web
cls
echo.
echo Menu ^> Websites:
echo 1. Website1
echo 2. Website2
echo.
echo 9. ^<= BACK
set /p choice=Enter your choice:
if "%choice%"=="1" Start "" "C:\Program Files\Google\Chrome\Application\chrome.exe" "https://website1.com"
if "%choice%"=="2" Start "" "C:\Program Files\Google\Chrome\Application\chrome.exe" "https://website2.com"
if "%choice%"=="9" goto menu
timeout /t 2 >NUL 2>&1
goto web
:exit
echo.
echo Exiting...
taskkill /f /im caffeine64.exe >NUL 2>&1
taskkill /f /im chrome.exe >NUL 2>&1
timeout /t 5 >NUL 2>&1
echo Logging off...
shutdown /l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment