【问题标题】:how to set monitor timeout to "never" using powershell如何使用powershell将监视器超时设置为“从不”
【发布时间】:2016-07-15 19:06:03
【问题描述】:

我想编写一个脚本,将“关闭显示器”和“让计算机进入睡眠状态”的电源设置更改为“从不”(参见随附的屏幕截图)。 我知道如何使用以下方法设置上述时间:

powercfg -change -monitor-timeout-ac [time]
powercfg -change -monitor-timeout-dc [time]
powercfg -change -standby-timeout-ac [time]
powercfg -change -standby-timeout-dc [time]

但我找不到如何将其设置为“从不”。

我需要使用什么语法?

谢谢!

【问题讨论】:

    标签: windows powershell settings sleep


    【解决方案1】:

    试试这个:

    powercfg -change -monitor-timeout-ac 0

    根据这个,我最喜欢的关于缺少帮助开关/参数信息的参考: http://ss64.com/nt/powercfg.html

    将任何值设置为 0 都会设置 timeout=Never

    感谢 Cristian,带有附加参数的官方文档是 currently available here

    【讨论】:

    猜你喜欢
    • 2012-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-02
    • 2015-11-09
    • 2012-10-07
    • 2012-09-15
    • 1970-01-01
    相关资源
    最近更新 更多