Powercfg Command-Line Options

You can use the Powercfg.exe tool to control power settings and configure computers to default to Hibernate or Standby modes.

The Powercfg.exe tool is installed with Windows.

Powercfg Command-Line Options

The following command-line options are available for Powercfg.

powercfg [-l] [-q ] [-x] [-changename] [-duplicatescheme] [-d] [-deletesetting] [-setactive] [-getactivescheme] [-setacvalueindex] [-setdcvalueindex] [-h] [-a] [-devicequery] [-deviceenablewake] [-devicedisablewake] [-import] [-export] [-lastwake] [-?] [-aliases] [-setsecuritydescriptor] [-getsecuritydescriptor]

 

Option Description

-list

-l

Lists all power schemes in the current user's environment.

Example:

powercfg -list

-query [Scheme_GUID] [Sub_GUID]

-q [Scheme_GUID] [Sub_GUID]

Displays the contents of the specified power scheme.

Usage:

powercfg -query [Scheme_GUID] [Sub_GUID]

SCHEME_GUID

(Optional) Specifies the GUID of the power scheme to display. Can be obtained by using the powercfg -l command.

SUB_GUID

(Optional) Specifies the GUID of the subgroup to display. Requires a SCHEME_GUID to be provided.

If neither SCHEME_GUID or SUB_GUID are provided, the settings of the current user's active power scheme are displayed.

If SUB_GUID is not specified, all settings in the specified power scheme are displayed.

-change settingvalue

-x setting value

Modifies a setting value in the current power scheme.

Usage:

powercfg–x setting value

setting

Specifies one of the following settings:

-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

value

Specifies the value in minutes.

Example:

powercfg-change-monitor-timeout-ac5

This sets the monitor idle timeout value to five minutes when operating on AC power.

-changename GUID name [scheme_description]

Modifies the name of a power scheme and, optionally, the scheme description.

Usage:

powercfg–changename GUID namescheme_description

GUID

Specifies the GUID of the power scheme

Name

Specifies the name of the power scheme.

scheme_description

Describes the power scheme.

If the description is omitted, then only the name will be changed.

-duplicatescheme GUID [DestinationGUID]

Duplicates the specified power scheme. The resulting GUID which represents the new scheme will be displayed.

Usage:

powercfg–duplicatescheme GUID [DestinationGUID]

GUID

Specifies a scheme GUID. Obtained by using the powercfg-l command.

DestinationGUID

Specifies the GUID where the scheme will be copied.

If DestinationGUID is omitted, then a new GUID will be created for the duplicated scheme.

-delete GUID

-d GUID

Deletes the power scheme with the specified GUID.

Usage:

Powercfg–delete GUID

GUID

Specifies the GUID of the scheme. Obtained by using the -list option.

-deletesetting Sub_GUID Setting_GUID

Deletes a power setting.

Usage:

powercfg–deletesetting Sub_GUID Setting_GUID

Sub_GUID

Specifies the subgroup GUID.

Setting_GUID

Specifies the power setting GUID.

-setactive Scheme_GUID

-s Scheme_GUID

Makes the specified power scheme active on the computer.

Usage:

Powercfg–setactive Scheme_GUID

Scheme_GUID

Specifies the scheme GUID.

-getactivescheme

Retrieves the currently active power scheme.

Usage:

Powercfg-getactivescheme

-setacvalueindex Scheme_GUID Sub_GUID Setting_GUID SettingIndex

Sets a value associated with a specified power setting while the computer is powered by AC power.

Usage:

powercfg–setacvalueindex Scheme_GUIDSub_GUIDSetting_GUIDSettingIndex

Scheme_GUID

Specifies a power scheme GUID. Obtained by using the -l option.

Sub_GUID

Specifies a subgroup of power setting GUID. Obtained by using the -q option.

Setting_GUID

Specifies an individual power setting GUID. Obtained by using the -q option.

SettingIndex

Specifies which of the list of possible values this power setting will be set to.

Example:

powercfg–setacvalueindex Scheme_GUID Sub_GUID Setting_GUID 5

This sets the power setting's AC value to the fifth entry in the list of possible values for this power setting.

-setdcvalueindex Scheme_GUID Sub_GUID Setting_GUID SettingIndex

Sets a value associated with a specified power setting while the computer is powered by DC power.

Usage:

powercfg–setdcvalueindex Scheme_GUID Sub_GUID Setting_GUID SettingIndex

Scheme_GUID

Specifies a power scheme GUID. Obtained by using the -l option.

Sub_GUID

Specifies a subgroup of power setting GUID. Obtained by using the -q option.

Setting_GUID

Specifies an individual power setting GUID. Obtained by using the -q option.

SettingIndex

Specifies which of the list of possible values this power setting will be set to.

Example:

powercfg–setdcvalueindex Scheme_GUID Sub_GUID Setting_GUID 5

This sets the power setting's DC value to the fifth entry in the list of possible values for this power setting.

-hibernate [on|off]

-h [on|off]

Enables or disables the hibernate feature. Hibernate timeout is not supported on all computers.

Example: powercfg-h on

-availablesleepstates

-a

Reports the sleep states available on the computer. Attempts to report reasons why sleep states are unavailable.

-devicequery query_flags

Returns a list of devices that meet the specified criteria.

Usage:

powercfg–devicequery query_flags

query_flags

Specifies one of the following criteria:

wake_from_S1_supported – Returns all devices that support waking the computer from a light sleep state.

wake_from_S2_supported – Returns all devices that support waking the computer from a deeper sleep state.

wake_from_S3_supported – Returns all devices that support waking the computer from the deepest sleep state.

wake_from_any – Returns all devices that support waking the computer from any sleep state.

S1_supported – Lists devices supporting light sleep.

S2_supported – Lists devices supporting deeper sleep.

S3_supported – Lists devices supporting deepest sleep.

S4_supported – Lists devices supporting hibernation.

wake_programmable – Lists devices that are user-configurable to wake the computer from a sleep state.

wake_armed – Lists devices that are currently configured to wake the computer from any sleep state.

all_devices – Returns all devices present in the computer.

all_devices_verbose – Returns a verbose list of devices.

Example:

powercfg -devicequery wake_armed

-deviceenablewake devicename

Enables the device to wake the computer from a sleep state.

Usage:

powercfg–deviceenablewake devicename

devicename

Specifies a device retrieved by using the powercfg-devicequerywake_programmable command.

Example:

powercfg-deviceenablewake"Microsoft USB IntelliMouse Explorer"

-devicedisablewake devicename

Disables the device from waking the computer from a sleep state.

Usage:

powercfg–devicedisablewake devicename

devicename

Specifies a device retrieved by using the powercfg-devicequerywake_armed command.

-import filename [GUID]

Imports all power settings from the specified file.

Usage:

powercfg–import filename [GUID]

filename

Specifies a fully qualified path to a file generated by using the powercfg-export option.

GUID

(optional) Represents the settings loaded into a power scheme. If not supplied, Powercfg will generate and use a new GUID

Example:

powercfg-importc:\scheme.pow

-export filename GUID

Exports a power scheme, represented by the specified GUID, to the specified file.

Usage:

powercfg -export filename GUID

filename

Specifies a fully qualified path to a destination file.

GUID

Specifies a power scheme GUID. Obtained by using the /l option.

Example:

powercfg -export c:\scheme.pow 381b4222-f694-41f0-9685-ff5bb260df2e

-lastwake

Reports information about the event that woke the computer from the last sleep transition.

-help

-?

Displays information about the Powercfg command-line options.

-aliases

Displays all aliases and their corresponding GUIDs. The user may use these aliases in place of any GUID at the command prompt

-setsecruitydescriptor [GUID|Action] SDDL

Sets a security descriptor associated with a specified power setting, power scheme, or action.

Usage:

powercfg -setsecuritydescriptor [GUID|Action] SDDL

GUID

Specifies a power scheme or a power setting GUID.

Action

Specifies one of the following strings: ActionSetActive, ActionCreate, ActionDefault

SDDL

Specifies a valid security descriptor string in SDD format. Call powercfg -getsecuritydescriptor to see an example SDDL STRING.

-getsecuritydescriptor [GUID|Action]

Gets a security descriptor associated with a specified power setting, power scheme, or action.

Usage:

powercfg -getsecuritydescriptor [GUID|Action]

GUID

Specifies a power scheme or a power setting GUID.

Action

Specifies one of the following strings: ActionSetActive, ActionCreate, ActionDefault

See Also

Tags :


Community Content

Wayne Hartell
Disabling sleep with a task that wakes from sleep doesn't work (the computer still sleeps).
To avoid your system going to sleep during an important task you may wish to disable sleep using the command line. Unfortunately it seems that if you try to accomplish this through a task that itself resumes from sleep (e.g., scheduled task) it fails to achieve the desired result.<br /><br /> Use case: Scheduled back-up of system that is set to sleep after X minutes. System is sleeping prior to the scheduled back-up. Need to wake the computer and disable sleep, else it will go to sleep during the back-up.<br /><br /> Pre-backup scheduled task (wakes from sleep and executes)<br /> powercfg -x standy-timeout-ac 0<br /><br /> Post-backup (re-enables sleep, where X is the number of minutes before the system should sleep)<br /> powercfg -x standy-timeout-ac X<br /><br /> The scheduled task to wake works fine, it also disables sleep so that when you inspect it from the control panel sleep appears to be disabled, however, confirmed by event viewer, Windows will then go back to sleep (due to Idle) even though sleep has been disabled.<br />
Tags :

ReveTahw
powercfg does not except "-" as operator need to use "/"
when I try to use <strong><em>powercfg -h off</em></strong> I get the error "<em>invalid parameters</em>" $0if I use <strong><em>powercfg /h off</em></strong>, it works$0 $0$0 $0 $0This is on Windows 7 Ultimate x64. As there a difference on how to use the parameters?$0
Tags :

lauwens
-qh option in Windows 7
<p>-QH Displays the contents of the specified power scheme, including hidden ones.</p> <pre> Usage: POWERCFG -QH &amp;lt;SCHEME_GUID&amp;gt; &amp;lt;SUB_GUID&amp;gt;</pre> <pre> &amp;lt;SCHEME_GUID&amp;gt; (optional) Specifies the GUID of the power scheme<br /> to display, can be obtained by using powercfg -l.<br /> &amp;lt;SUB_GUID&amp;gt; (optional) Specifies the GUID of the subgroup<br /> to display. Requires a SCHEME_GUID to be provided.</pre> <p>If neither SCHEME_GUID or SUB_GUID are provided, the settings of the current user's active power scheme, including hidden settings, are displayed. If SUB_GUID is not specified, all settings in the specified power scheme, including hidden settings, are displayed.</p>
Tags :

msharoknian
-energy option in Windows 7
<p>-ENERGY<br />Analyze the system for common energy-efficiency and battery life problems. The ENERGY command should be used when the computer is idle and with no open programs or documents. The ENERGY command will generate an HTML report file in the current path. The ENERGY command supports the following optional parameters:</p> <pre> Usage: POWERCFG -ENERGY [-OUTPUT &amp;amp;lt;FILENAME&amp;amp;gt;] [-XML]<br /> [-DURATION &amp;amp;lt;SECONDS&amp;amp;gt;]<br /> POWERCFG -ENERGY -TRACE [-D &amp;amp;lt;FILEPATH&amp;amp;gt;]<br /> [-DURATION &amp;amp;lt;SECONDS&amp;amp;gt;]<br /> -OUTPUT &amp;amp;lt;FILENAME&amp;amp;gt; - Specify the path and filename to store the<br /> energy report HTML file.<br /> -XML - Format the report file as XML.<br /> -TRACE - Record system behavior and do not perform<br /> analysis. Trace files will be generated in<br /> the current path unless the -D parameter<br /> is specified.<br /> -D &amp;amp;lt;FILEPATH&amp;amp;gt; - Specify the directory to store trace data.<br /> May only be used with the -TRACE parameter.</pre> <pre> -DURATION &amp;amp;lt;SECONDS&amp;amp;gt; - Specify the number of seconds to observe<br /> system behavior. Default is 60 seconds.</pre>

Steve6375
Save current config
<p>How about an easy way to save the current power config in a script.<br /></p> <p>I want to save the current config, change it (e.g. prevent standby and hibernate timeouts), run a long command, then restore the saved power config and set it as the current scheme. There seems to be no command to 'export current scheme'</p> <p> <br /> </p> <p>e.g.<br /></p> <p>powercfg -Export current.POW<br /></p> <p> <br /> </p> <p> <br /> </p>
Tags :

John E [MSFT]
Note: -REQUESTSOVERRIDE is case-sensitive
Please note that -REQUESTSOVERRIDE (in Win7) is case-sensitive.
Tags :

Thomas Lee
- requests and requestsoverride option in Windows 7
-REQUESTS Enumerate application and driver Power Requests. Power Requests prevent the computer from automatically powering off the display or entering a low-power sleep mode.<br /><br />-REQUESTSOVERRIDE Sets a Power Request override for a particular Process, Service, or Driver. If no parameters are specified, this command displays the current list of Power Request Overrides.<br /><br />Usage: POWERCFG -REQUESTSOVERRIDE &lt;CALLER_TYPE&gt; &lt;NAME&gt; &lt;REQUEST&gt; <br />&lt;CALLER_TYPE&gt; Specifies one of the following caller type: PROCESS, SERVICE, DRIVER. This is obtained by calling the POWERCFG -REQUESTS command.<br />&lt;NAME&gt; Specifies the caller name. This is the name returned from calling POWERCFG -REQUESTS command.<br />&lt;REQUEST&gt; Specifies one or more of the following Power. Request Types: Display, System, Awaymode.<br />Example: POWERCFG -REQUESTSOVERRIDE PROCESS wmplayer.exe Display System$0 $0 $0To remove the power request override, use the -REQUESTSOVERRIDE option, but do not specify any type of override (System, Display, AwayMode) as in the following example:<br />Example:<br /> POWERCFG -REQUESTSOVERRIDE PROCESS wmplayer.exe
Tags :

Mark Aggar
-waketimers option in Windows 7
-WAKETIMERS<br /> Enumerate the active wake timers. If enabled, the expiration of a wake timer wakes the system from sleep and hibernate states.
Tags :

Page view tracker