@echo off setlocal

REM 设置关机时间为 17 点 23 分 set shutdown_hour=17 set shutdown_minute=23

REM 获取当前时间 for /f "tokens=1-3 delims=:." %%a in ("%time%") do ( set current_hour=%%a set current_minute=%%b )

REM 计算距离关机时间的秒数 set /a shutdown_seconds=(%shutdown_hour%*3600 + %shutdown_minute%*60) - (%current_hour%*3600 + %current_minute%*60)

REM 设置关机命令 shutdown -s -t %shutdown_seconds%

endlocal


原文地址: https://www.cveoy.top/t/topic/pNae 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录