用DOS批处理,实现天天定时关机
第一种是多一个判断
echo off
set /a "time1=%time:~0,2%*60+%time:~3,2%"
set /a "time2=22*60+30"
if %time1% gtr %time2% shutdown /s /t 60 /f
else at 22:30 "shutdown /s /t 60 /f"
第二种是直接一句话,直接实现定时关机
at /every:m,t,w,th,f,s,su 22:30 "shutdown /s /t 0 /f"
感受第二种很精简,并且很犀利。因此就转过来收藏了。
摘自CSDN里面的一个帖子