CODE: [Copy to clipboard]
@echo off&title 自定义关机时间
color 17
mode con: cols=80 lines=25
net start|find /i "Task Scheduler">nul 2>nul||sc config schedule start= Auto>nul 2>nul&net start schedule>nul 2>nul
:b
echo\
for /f "tokens=1,2,3,4 delims=- " %%a in ('date /t') do set name=%%a年%%b月%%c日 %%d
echo.当前时间为%name% %time:~,-6%
set /p var=请以00:00格式输入一个关机时间,要消除之前设定请输入C:
if "%var%"=="" echo 请输入时间&goto b
if /i %var% == C goto c
at %var% shutdown /f /s /t 0 >nul 2>nul
if %errorlevel% EQU 0 goto a
if not %errorlevel% EQU 0 (
echo 格式有误,请重新输入.
)&(
goto b
)
:a
color 1a
echo.系统将在%var%关机.
goto d
:c
at /d /y >nul 2>nul
echo.已清除关机时间.
goto b
:d
pause