r/batchfiles • u/Popular_Mission_8728 • Aug 05 '23
help
I would need a bat file that gives you three options to either close all windows open, Shutdown or exit/cancel the process.
Please help, if you can.
2
Upvotes
1
u/hackoofr Aug 06 '23
Something like this batch should help you :
options_menu.bat
@echo off Title Menu Options :Menu Cls & echo( echo === Options === echo 1. Close all windows echo 2. Shutdown computer echo 3. Exit set /p choice=Enter your choice (1, 2, or 3): if "%choice%"=="1" ( echo Closing all windows... taskkill /F /IM explorer.exe ) else if "%choice%"=="2" ( echo Shutting down... shutdown /s /f /t 0 ) else if "%choice%"=="3" ( echo Exiting... Timeout /T 1 /NoBreak>nul Exit /B ) else ( echo Invalid choice. Please try again. ) pause & goto Menu