通过命令行关闭省电选项

发布于 2024-07-08 21:31:35 字数 168 浏览 5 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

能否归途做我良人 2024-07-15 21:31:35

将值设置为从不可以通过将0值传递给-change选项来完成,即:

powercfg.exe -change -monitor-timeout-ac 0

表示监视器超时将设置为“从不”。 因此演示计划可以通过以下方式实现:

powercfg.exe -change -monitor-timeout-ac 0
powercfg.exe -change -disk-timeout-ac 0
powercfg.exe -change -standby-timeout-ac 0
powercfg.exe -change -hibernate-timeout-ac 0

Setting a value to never can be done by passing a value of 0 to the -change option, i.e.:

powercfg.exe -change -monitor-timeout-ac 0

means the monitor timeout will be set to "Never". So the presentation plan can be achieved via:

powercfg.exe -change -monitor-timeout-ac 0
powercfg.exe -change -disk-timeout-ac 0
powercfg.exe -change -standby-timeout-ac 0
powercfg.exe -change -hibernate-timeout-ac 0
听,心雨的声音 2024-07-15 21:31:35

powercfg.exe 在 Vista 中的工作方式略有不同,默认情况下不包含“演示”配置文件(至少在我的计算机上)。因此您可以设置“演示”配置文件,然后使用以下命令获取 GUID

<前><代码>powercfg.exe -list

以及将其设置为该 GUID 的以下内容:

<前><代码>powercfg.exe -setactive GUID

或者,您可以将 powercfg.exe 与 -change 或 -X 一起使用来更改当前电源方案的特定参数。

来自“powercfg.exe /?”的片段:

-CHANGE、-X 修改当前电源方案中的设置值。

 用法:POWERCFG -X <设置>   <值> 

            <设置>   指定以下选项之一: 
                        -monitor-timeout-ac <分钟> 
                        -monitor-timeout-dc <分钟> 
                        -disk-timeout-ac <分钟> 
                        -disk-timeout-dc <分钟> 
                        -standby-timeout-ac <分钟> 
                        -standby-timeout-dc <分钟> 
                        -hibernate-timeout-ac <分钟> 
                        -hibernate-timeout-dc <分钟> 

            例子: 
                POWERCFG -更改-监视器超时-ac 5 

            这会将监视器空闲超时值设置为 5 分钟 
            使用交流电源时。 
  

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

powercfg.exe -list

and the following to set it to that GUID:

powercfg.exe -setactive 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 /?":

-CHANGE, -X Modifies a setting value in the current power scheme.

          Usage: POWERCFG -X <SETTING> <VALUE>

          <SETTING>   Specifies one of the following options:
                      -monitor-timeout-ac <minutes>
                      -monitor-timeout-dc <minutes>
                      -disk-timeout-ac <minutes>
                      -disk-timeout-dc <minutes>
                      -standby-timeout-ac <minutes>
                      -standby-timeout-dc <minutes>
                      -hibernate-timeout-ac <minutes>
                      -hibernate-timeout-dc <minutes>

          Example:
              POWERCFG -Change -monitor-timeout-ac 5

          This would set the monitor idle timeout value to 5 minutes
          when on AC power.
心安伴我暖 2024-07-15 21:31:35

(至少)对于 Windows 7:

不错的快捷方式是:

  • powercfg -ALIASES # 列出可用配置文件的命名别名。
  • powercfg -S SCHEME_MIN #使用别名 SCHEME_MIN 激活(高性能)方案
  • powercfg -S SCHEME_MAX #使用别名 SCHEME_MAX 激活(最大节能)方案
  • powercfg -S SCHEME_BALANCED # ...平衡能源方案

欢呼

Kai

(at least) for windows 7:

Nice Shortcuts are:

  • powercfg -ALIASES # Lists named aliases for available profiles.
  • powercfg -S SCHEME_MIN #Activates the (High-Performance) Scheme with the alias SCHEME_MIN
  • powercfg -S SCHEME_MAX #Activates the (Max-Energie-Saving) Scheme with the alias SCHEME_MAX
  • powercfg -S SCHEME_BALANCED # ... Balanced Energie Scheme

cheers

Kai

神也荒唐 2024-07-15 21:31:35

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

夜巴黎 2024-07-15 21:31:35

在 Vista 中,您创建一个电源配置文件并使用命令行 powercfg 选择该配置文件请参阅此处

In Vista you create a power profile and use the commandline powercfg to select that profile see here

╰◇生如夏花灿烂 2024-07-15 21:31:35
@ECHO OFF

powercfg -change -monitor-timeout-ac 0
powercfg -change -standby-timeout-ac 0
powercfg -change -disk-timeout-ac 0
powercfg -change -hibernate-timeout-ac 0

这会起作用

@ECHO OFF

powercfg -change -monitor-timeout-ac 0
powercfg -change -standby-timeout-ac 0
powercfg -change -disk-timeout-ac 0
powercfg -change -hibernate-timeout-ac 0

This will work

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文