How to make this BATch file have a timer (time left to shutdown or reset)? -
how make batch file have timer? see how time left. windows says "windows shut down in less minute".
@echo off color 0a title restart\/shutdown :start echo welcome, %username% echo do? echo. echo 1. shut down echo 2. restart echo. echo 0. quit echo. set /p choice="enter choice: " if "%choice%"=="1" goto shutdown if "%choice%"=="2" goto restart if "%choice%"=="0" exit echo invalid choice: %choice% echo. pause cls goto start :shutdown shutdown.exe -s -t 10 :restart shutdown.exe -r -t 10
you use command "timeout /t 10" or like:
@echo off /l %%# in (10,-1,1) (set/p "=%%# seconds left... "<nul: ping -n 2 127.0.0.1 >nul cls:)
Comments
Post a Comment