實用批次檔範例,支援多時段排程關機,關機前 60 秒彈出訊息提醒,適合固定作息或停電預警場景。
@echo off
at 22:50 every:M,T,W,Th,F,S,Su shutdown -s -t 60 -c "很晚了,該睡覺了!"
at 13:50 every:M,T,W,Th,F,S,Su shutdown -s -t 60 -c "要停電了,快存檔吧!"
at 15:50 every:M,T,W,Th,F,S,Su shutdown -s -t 60 -c "要停電了,快存檔吧!"
at 9:50 every:M,T,W,Th,F,S,Su shutdown -s -t 60 -c "要停電了,快存檔吧!"
at 5:50 every:M,T,W,Th,F,S,Su shutdown -s -t 60 -c "要停電了,快存檔吧!"
echo 已經完成!
pause&end
定時關機.bat參數說明:shutdown -s 關機、-t 60 60 秒倒數、-c 自訂提示訊息。可依需求增減時段與訊息。