如何使这个BATch文件有一个计时器(剩余时间关闭或重置)?(How to make this BATch file have a timer (time left to shutdown or reset)?)
如何使这个BATch文件有一个计时器? 想看看剩下多少时间。 Windows只会说“Windows将在不到一分钟内关闭”。
@echo off color 0A title Restart\/Shutdown :start echo Welcome, %USERNAME% echo What would you like to do? echo. echo 1. Shut down echo 2. Restart echo. echo 0. Quit echo. set /p choice="Enter your 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 10How to make this BATch file have a timer? Would like to see how much time left. Windows only says "Windows will shut down in less then a minute".
@echo off color 0A title Restart\/Shutdown :start echo Welcome, %USERNAME% echo What would you like to do? echo. echo 1. Shut down echo 2. Restart echo. echo 0. Quit echo. set /p choice="Enter your 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最满意答案
你可以使用命令“timeout / t 10”或类似的东西:
@ECHO OFF FOR /L %%# IN (10,-1,1) DO (SET/P "=%%# seconds left... "<NUL: PING -n 2 127.0.0.1 >NUL CLS:)You could use the command "timeout /t 10" or something like:
@ECHO OFF FOR /L %%# IN (10,-1,1) DO (SET/P "=%%# seconds left... "<NUL: PING -n 2 127.0.0.1 >NUL CLS:)更多推荐
发布评论