给 Windows 设置定时关机
用 shutdown /s /t 让 Windows 在指定秒数后自动关机,用 shutdown /a 随时取消。
运行:shutdown /s /t 3600(3600 秒 = 1 小时);想取消就运行:shutdown /a
01命令
命令
$ shutdown /s /t 360002作用说明
/t 后面跟的是秒数,比如 /t 3600 是一小时后关机,/t 300 是五分钟后关机。Windows 会弹出通知,显示具体的关机时间。倒计时结束前,随时运行 shutdown /a 即可取消本次定时关机。
03风险
!注意: 关机时未保存的内容会丢失,请先保存文件;除非确有需要,不要加 /f 强制关闭程序。
04撤销
撤销
$ shutdown /a05来源
- Shutdown.exe - Shutdown the computer依据: Documents /s (shutdown), /t xxx (time-out period in seconds before shutdown) and /a (Cancel a system shut down during the time-out period).
- shutdown (Windows Commands)依据: Reference page lists /s to shut down the computer, /t <seconds> to set the time-out before shutdown, and /a to abort a pending shutdown.
最后验证: 2026-09-19 · 分类: 系统与设置