Share via


Powercfg Command-Line Options

3/21/2011

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

The Powercfg.exe tool is installed with Standard 7 in the %WINDIR%\System32 folder.

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][-requests][-requestsoverride][-energy][-waketimers]

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.

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 setting value

- x setting value

Modifies a setting value in the current power scheme.

setting

Must be one of the following settings:

  • -monitor-timeout-ac
  • -monitor-timeout-dc
  • -disk-timeout-ac
  • -disk-timeout-dc
  • -standby-timeout-ac
  • -standby-timeout-dc
  • -hibernate-timeout-ac
  • -hibernate-timeout-dc

value

Specifies the value in minutes.

Example:

powercfg -change -monitor-timeout-ac 5 

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.

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.

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, a new GUID will be created for the duplicated scheme.

-delete GUID

-d GUID

Deletes the power scheme with the specified GUID.

GUID

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

-deletesetting Sub_GUID Setting_GUID

Deletes a power setting.

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.

Scheme_GUID

Specifies the scheme GUID.

-getactivescheme

Retrieves the currently active power scheme.

-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.

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.

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 time-out is not supported on all computers.

Example:

powercfg -h on

-availablesleepstates

-a

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

-devicequery query_flags

Returns a list of devices that meet the specified criteria.

query_flags

Must be one of the following values:

  • wake_from_S1_supported
    return all devices that support waking the system from a light-sleep state.
  • wake_from_S2_supported
    return all devices that support waking the system from a deeper sleep state.
  • wake_from_S3_supported
    return all devices that support waking from the deepest sleep state.
  • wake_from_any
    return all devices that support waking from any sleep state.
  • S1_supported
    list devices supporting light sleep states.
  • S2_supported
    list devices supporting deeper sleep.
  • S3_supported
    list devices supporting deepest sleep.
  • S4_supported
    list devices supporting system hibernation.
  • wake_programmable
    list devices that are user-configurable to wake the system from a sleep state.
  • wake_armed
    list devices that are currently configured to wake the system from any sleep state.
  • all_devices
    return all devices present in the system.
  • all_devices_verbose
    return verbose list of devices.

Example:

powercfg -devicequery wake_armed 

-deviceenablewake devicename

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

devicename

Specifies a device retrieved by using the powercfg -devicequery wake_programmable command.

Example:

powercfg -deviceenablewake "Microsoft USB IntelliMouse Explorer" 

-devicedisablewake devicename

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

devicename

Specifies a device retrieved by using the powercfg -devicequery wake_armed command.

-import filename [GUID]

Imports all power settings from the specified file.

filename

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

GUID

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

Example:

powercfg -import c:\scheme.pow 

-export filename GUID

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

filename .

Specifies a fully qualified path of 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 can use these aliases instead of any GUID at the command prompt.

-setsecuritydescriptor [GUID|Action] SDDL

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

GUID

Specifies a power scheme or a power setting

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.

GUID

Specifies a power scheme or a power setting GUID.

Action

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

-requests

Enumerates application Power Requests and driver Power Requests.

Ff794903.note(en-US,WinEmbedded.1001).gifNote:
Power Requests prevent the computer from automatically powering off the display or entering a low-power sleep mode.

-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.

<CALLER_TYPE>

Specifies one of the following caller types: Process, Service, Driver.

<NAME>

Specifies the caller name.

<REQUEST>

Specifies one or more of the following Power Request Types: Display, System, Awaymode.

-energy

Analyses the system for common energy efficiency and battery life problems.

-OUTPUT <FILENAME>

Specifies the path and file name to store the energy report HTLM file.

-XML

Format the report file as XML.

-TRACE

Records system behavior and does not perform analysis. Trace files will be generated in the current path unless the -D parameter is specified.

-D <FILEPATH>

Specifies the directory to store trace data.

-DURATION <SECONDS>

Specified the number of seconds to observe system behavior.

-waketimers

Enumerates the active wake timers.

See Also

Other Resources

Command-Line Tools Technical Reference