views:

3096

answers:

4

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?

A: 

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

Martin Beckett
A: 

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

A: 

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.
jeremyasnyder
+1  A: 

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
Nick