Turn off power saving options via command line
Asked Answered
M

6

14

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?

Menes answered 31/10, 2008 at 16:14 Comment(0)
H
4

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.
Hornwort answered 31/10, 2008 at 16:36 Comment(0)
M
11

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
Menes answered 3/11, 2008 at 14:28 Comment(0)
H
4

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.
Hornwort answered 31/10, 2008 at 16:36 Comment(0)
N
4

(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

Nason answered 7/6, 2014 at 9:19 Comment(0)
S
1

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

Suppurative answered 31/10, 2008 at 16:31 Comment(0)
U
0

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

Unknow answered 31/10, 2008 at 16:28 Comment(0)
H
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

Hals answered 28/11, 2016 at 13:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.