windows - 如何使用 powershell 将监视器超时设置为 "never"

标签 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 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/

相关文章:

java - 如何将菜单设置为 AppBarLayout

windows - Azure 是操作系统还是框架?

windows - 欧拉问题和 Int64 类型递归的性能问题

azure - 使用 PowerShell 查询多域中的 SamAccountName

azure - "Get-AzureRmWebApp"需要哪个模块?

cakephp-2.0 - CakePHP 控制台给出错误 "Undefined index: HTTP_HOST"

visual-studio - VS 2015 导入导出设置,消失窗口

c - OpenGL 默认帧缓冲区内容在最小化/恢复周期后消失了吗?

python - 有没有办法使用 pip 一次安装所有 python 模块?

powershell - Powershell将stderr和stdout重定向到两个不同的位置