通过命令行关闭省电选项
在 Windows XP 上,脚本中的以下命令将阻止在 PC 上启用任何省电选项(显示器睡眠、HD 睡眠等)。 这对于信息亭应用程序很有用。
powercfg.exe /setactive presentation
Vista 上的等效项是什么?
On Windows XP, the following command in a script will prevent any power saving options from being enabled on the PC (monitor sleep, HD sleep, etc.). This is useful for kiosk applications.
powercfg.exe /setactive presentation
What is the equivalent on Vista?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
将值设置为从不可以通过将
0
值传递给-change
选项来完成,即:表示监视器超时将设置为“从不”。 因此演示计划可以通过以下方式实现:
Setting a value to never can be done by passing a value of
0
to the-change
option, i.e.:means the monitor timeout will be set to "Never". So the presentation plan can be achieved via:
powercfg.exe 在 Vista 中的工作方式略有不同,默认情况下不包含“演示”配置文件(至少在我的计算机上)。因此您可以设置“演示”配置文件,然后使用以下命令获取 GUID
以及将其设置为该 GUID 的以下内容:
或者,您可以将 powercfg.exe 与 -change 或 -X 一起使用来更改当前电源方案的特定参数。
来自“powercfg.exe /?”的片段:
powercfg.exe works a little differently in Vista, and the "presentation" profile isn't included by default (at least on my machine. so you can setup a "presentation" profile and then use the following to get the GUID
and the following to set it to that GUID:
Alternatively, you can use powercfg.exe with the -change or -X to change specific parameters on the current power scheme.
Snippet from "powercfg.exe /?":
(至少)对于 Windows 7:
不错的快捷方式是:
欢呼
Kai
(at least) for windows 7:
Nice Shortcuts are:
cheers
Kai
C:\Windows\system32>powercfg /list
现有电源方案(* 活动)
电源方案 GUID:381b4222-f694-41f0-9685-ff5bb260df2e(平衡) * 电源
方案 GUID:8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c(高性能) )
电源方案 GUID:a1841308-3541-4fab-bc81-f71556f20b4a(省电模式)
C:\Windows\system32>powercfg /setactive a1841308-3541-4fab-bc81-f71556f20b4a
C:\Windows\system32>powercfg /list
Existing Power Schemes (* Active)
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)
C:\Windows\system32>powercfg /setactive a1841308-3541-4fab-bc81-f71556f20b4a
在 Vista 中,您创建一个电源配置文件并使用命令行 powercfg 选择该配置文件请参阅此处
In Vista you create a power profile and use the commandline powercfg to select that profile see here
这会起作用
This will work