1、定时关机
# 注:/s 关机, /t 后面接时间,单位是秒
shutdown /s /t 3600 #一个小时后关机
shutdown -a #取消定时关机
注:"shutdown /h"是立即进入休眠的命令,但/h参数不能与/t连用,故不能用shutdown实现定时休眠的功能。/h可与/f连用,/f 表示强制关闭正在运行的应用程序而不事先警告用户。
2、定时休眠
以管理员身份运行cmd或者powershell
powercfg -h on
schtasks /create /tn my-standby /tr "rundll32.exe powrprof.dll,SetSuspendState" /sc once /st 23:30
schtasks /delete /tn my-standby # 取消定时任务
3、定时睡眠(定时待机):
以管理员身份运行cmd或者powershell
powercfg -h off
schtasks /create /tn my-standby /tr "rundll32.exe powrprof.dll,SetSuspendState" /sc once /st 23:30
注:查看休眠是否开启:powercfg /a
在"powercfg -h on"状态下,以管理员身份运行"rundll32.exe powrprof.dll,SetSuspendState 0,1,0"不会进入睡眠,而是休眠。
————————————————
版权声明:本文为CSDN博主「conanluffy」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/conanluffy/article/details/103153583
- conanluffy 103153583 命令 article detailsconanluffy 103153583命令article 130380746 58018769 article details 123027193 wufagang article details libin9ioak 127749042 article details skywalking 129704345 article details qfturauyls 127044930 article details 519640026 106940115 article details conanluffy 103153583 articles