Windows 如何将监视器超时设置为";决不;使用powershell

Windows 如何将监视器超时设置为";决不;使用powershell,windows,powershell,settings,sleep,Windows,Powershell,Settings,Sleep,我想写一个脚本,将“关闭显示器”和“使计算机进入睡眠”的电源设置更改为“从不”(见附件屏幕截图)。 我知道如何使用以下方法设置上述时间: 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 [time]
powercfg -change -monitor-timeout-dc [time]
powercfg -change -standby-timeout-ac [time]
powercfg -change -standby-timeout-dc [time]
但我找不到如何将其设置为“从不”

我需要使用什么语法

谢谢大家!

试试这个:

powercfg-更改-监视器超时ac 0

根据本文,我最喜欢的关于缺少帮助开关/参数信息的参考:

将任何值设置为0将设置超时=从不


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

非常感谢您的帮助!我曾想过尝试0,但担心它可能会将屏幕关闭时间设置为零,实际上会将我锁定在外:)文档也可以在