C:\Windows\System32\shutdown.exe — 系統內建關機程序。
at — 任務計劃服務命令行接口(需 Schedule 服務運行)。
at HH:MM shutdown -s [-t 秒數] [-c "提示信息"] [-f]
| 需求 | 命令 | 說明 |
|---|---|---|
| 23:00 自動關機 | at 23:00 shutdown -s | 默認 30 秒倒計時提示保存文檔 |
| 23:00 強制關機(不等待) | at 23:00 shutdown -s -f -t 0 | -f 強制關閉程序,-t 0 立即執行 |
| 23:00 關機並顯示自定義信息 | at 23:00 shutdown -s -c "系統維護,請保存工作" | -c 信息最長 127 字符 |
| 取消已排程關機 | shutdown -a | 隨時運行即可撤銷 |
| 60 秒後重啟 | shutdown -r -t 60 | -r 重啟 |
| 注銷當前用戶 | shutdown -l | -l 注銷 |
| 遠程關機(需權限) | shutdown -m \\PCNAME -s | -m 指定目標計算機 |
-s 關閉本地計算機-r 關機並重啟-a 取消關機/重啟-l 注銷當前用戶-f 強制關閉應用程序(不提示保存)-t xxx 設置倒計時秒數-c "msg" 關機對話框顯示信息-i 圖形界面(必須為首參數)-m \\computer 遠程操作shutdown -s -t 3600 -c "1小時後自動關機"(3600 秒 = 1 小時)。shutdown -a 快捷方式。