我想编写一个脚本,将“关闭显示器”和“让计算机进入休眠状态”的电源设置更改为“从不”(见附件截图)。 我知道如何设置上述使用的时间:
powercfg -change -monitor-timeout-ac [time]
powercfg -change -monitor-timeout-dc [time]
powercfg -change -standby-timeout-ac [time]
powercfg -change -standby-timeout-dc [time]
但我找不到如何将其设置为“从不”。
我需要使用什么语法?
谢谢!
最佳答案
试试这个:
powercfg -change -monitor-timeout-ac 0
据此,我最喜欢的缺少帮助开关/参数信息的引用资料: http://ss64.com/nt/powercfg.html
Setting any value to 0 will set the timeout=Never
感谢 Cristian,带有附加参数的官方文档是 currently available here
关于windows - 如何使用 powershell 将监视器超时设置为 "never",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36263756/