Windows command line powercfg command

Updated: 06/30/2020 by Computer Hope
powercfg command

The powercfg command allows users to view and modify the power plans and settings for their Windows computer. Using powercfg provides similar control over the power settings as does the Windows Power Options utility.

Availability

Powercfg is an external command that is available for the following Microsoft operating systems as powercfg.exe.

Powercfg syntax

Windows Vista and later syntax

powercfg [/a] [/aliases]
  [/changename scheme_GUID scheme_name scheme_description]
  [/d scheme_GUID] [/deletesetting sub_GUID setting_GUID]
  [/devicedisablewake device_name] [/deviceenablewake device_name]
  [/devicequery query_flag] [/duplicatescheme scheme_GUID destinationGUID]
  [/energy [/output filename] [/xml] [/duration sec] [/trace] [/d filepath]]
  [/export filename scheme_GUID] [/getactivescheme] 
  [/getsecuritydescriptor GUID|Action] [/h on|off] 
  [/import filename scheme_GUID] [/l] [/lastwake] [/q scheme_GUID sub_GUID] 
  [/requests] [/requestsoverride caller_type caller_name request] 
  [/s scheme_GUID] 
  [/setacvalueindex scheme_GUID sub_GUID setting_GUID setting_index] 
  [/setdcvalueindex scheme_GUID sub_GUID setting_GUID setting_index] 
  [/setsecuritydescriptor GUID|action SDDL] [/waketimers] 
  [/x scheme_setting setting_value] [/?]

Options

/a Displays available sleep states.
/aliases Displays all power scheme aliases and each of their GUIDs. A power scheme alias can be used in place of the scheme_GUID in other options.
/changename scheme_GUID scheme_name scheme_description Changes the name and description of the specified power scheme.
scheme_description is optional, and if omitted, only the scheme name is changed.
/d scheme_GUID Deletes the scheme_GUID power scheme. Use powercfg /l to obtain the scheme_GUID.
/deletesetting sub_GUID setting_GUID Delete the setting_GUID power setting for the sub_GUID subgroup.
/devicedisablewake device_name Prevents the device_name device from waking the computer from its sleep state.
Use powercfg /devicequery wake_armed to obtain the device_name.
/deviceenablewake device_name Allows the device_name device to wake the computer from its sleep state.
Use powercfg /devicequery wake_programmable to obtain the device_name.
/devicequery query_flag Displays devices that meet the query_flag.
Available query flags are:
all_devices
all_devices_verbose
S1_supported
S2_supported
S3_supported
S4_supported
wake_armed
wake_from_any
wake_from_S1_supported
wake_from_S2_supported
wake_from_S3_supported
wake_programmable
/duplicatescheme scheme_GUID destinationGUID Copies the scheme_GUID power scheme to the destinationGUID power scheme.
destinationGUID is optional, and if omitted, a new power scheme GUID is created.
Use powercfg /l to obtain the scheme_GUID.
/energy [/output filename] [/xml] [/duration seconds] [/trace] [/d filepath] Identifies common battery life and energy-efficiency problems on the computer. Only available in Windows 7 and specific Windows 10 Insider builds.
/output filename - specifies the name and path of the generated HTML report file.
/xml - generates the report as an XML file.
/duration seconds - sets the amount of time, in seconds, to record and analyze the computer system's behavior.
/trace - causes the process to only record computer system's behavior, preventing analysis of that behavior.
/d filepath - specifies the location of where to save the trace details.
/export filename scheme_GUID Exports the scheme_GUID power scheme and saves to the filename file.
Use powercfg /l to obtain the scheme_GUID.
/getactivescheme Displays the currently active power scheme.
/getsecuritydescriptor action|GUID Displays the security descriptor assigned to the GUID power scheme, GUID power setting, or action.
Available action values are ActionCreate, ActionDefault, ActionSetActive.
Use powercfg /getsecuritydescriptor to view SDDL strings.
/h on|off Enable or disable hibernate mode on the computer.
/import filename scheme_GUID Import all power settings from the filename file to the scheme_GUID power scheme.
scheme_GUID is optional, and if omitted, a new power scheme is created.
The filename file is created by using the /export option.
Use powercfg /l to obtain the scheme_GUID.
/lastwake Displays details about the event that caused the computer to wake from its sleep state.
/q scheme_GUID sub_GUID Displays contents of the scheme_GUID power scheme.
scheme_GUID and sub_GUID are optional, and if omitted, contents of the currently active power scheme are displayed.
Use powercfg /l to obtain the scheme_GUID.
Use powercfg /q to obtain the sub_GUID.
/requests Displays power requests for applications and drivers.
/requestsoverride caller_type caller_name request Sets the request power request override for caller_name and caller_type.
Available request values are Awaymode, Display, System.
Use powercfg /requests to obtain caller_name and caller_type.
/s scheme_GUID Set the scheme_GUID power scheme to be active.
Use powercfg /l to obtain the scheme_GUID.
/setacvalueindex scheme_GUID sub_GUID setting_GUID setting_index Sets the setting_index value for the scheme_GUID power scheme and sub_GUID setting_GUID power setting, when computer is using AC power.
Use powercfg /l to obtain the scheme_GUID.
Use powercfg /q to obtain the sub_GUID and setting_GUID.
/setdcvalueindex scheme_GUID sub_GUID setting_GUID setting_index Sets the setting_index value for the scheme_GUID power scheme and sub_GUID setting_GUID power setting, when computer is using DC power.
Use powercfg /l to obtain the scheme_GUID.
Use powercfg /q to obtain the sub_GUID and setting_GUID.
/setsecuritydescriptor action|GUID SDDL Set the SDDL security descriptor for the GUID power scheme, GUID power setting, or action.
Available action values are ActionCreate, ActionDefault, ActionSetActive.
Use powercfg /getsecuritydescriptor to view SDDL strings.
/waketimers Displays the active wake timers.
/x scheme_setting setting_value For the currently active power scheme, change scheme_setting to setting_value.
Settings available to change are:
processor-throttle-ac throttle
processor-throttle-dc throttle
disk-timeout-ac minutes
disk-timeout-dc minutes
hibernate-timeout-ac minutes
hibernate-timeout-dc minutes
monitor-timeout-ac minutes
monitor-timeout-dc minutes
standby-timeout-ac minutes
standby-timeout-dc minutes

Available values for throttle are ADAPTIVE, CONSTANT, DEGRADE, NONE.
Setting minutes to 0 means never timeout.
/? Displays all options for powercfg command.

Windows XP syntax

powercfg [/a] [/b low|critical settings] 
  [/change scheme_settings setting_value] [/c scheme_name] 
  [/d scheme_name] [/devicedisablewake device_name] 
  [/deviceenablewake device_name] 
  [/devicequery flagquery} [/export scheme_name [/file filename]] 
  [/g on|off] [/h on|off] [/import scheme_name [/file filename]] 
  [/l] [/n integer] [/option flag] [/q scheme_name] [/s scheme_name] [/?]

Options

/a Displays available sleep states.
/b low|critical settings Configure the settings setting for the low|critical battery alarm.
Available settings are:
/action hibernate|shutdown|standby|none - The action to take when the battery alarm is activated.
/activate on|off - Turn battery alarm on or off.
/forceaction on|off - Force the standby or shutdown of the computer, even if a program is not responding.
/level percentage (0-100) - Trigger the battery alarm when battery power level reaches percentage.
/program on|off - Specify a program to run when the battery alarm is activated. Can use schtasks.exe /change command to configure the program.
/sound on|off - Turns the battery alarm sound on or off.
/text on|off - Turns the battery alarm notification text on or off.
/c scheme_name Creates a new power scheme, named scheme_name.
/change scheme_setting setting_value For the currently active power scheme, change scheme_setting to setting_value.
Settings available to change are:
processor-throttle-ac throttle
processor-throttle-dc throttle
disk-timeout-ac minutes
disk-timeout-dc minutes
hibernate-timeout-ac minutes
hibernate-timeout-dc minutes
monitor-timeout-ac minutes
monitor-timeout-dc minutes
standby-timeout-ac minutes
standby-timeout-dc minutes

Available values for throttle are ADAPTIVE, CONSTANT, DEGRADE, NONE.
Setting minutes to 0 means never timeout.
/d scheme_name Deletes the scheme_name power scheme.
Use powercfg /l to obtain the scheme_name.
/devicedisablewake device_name Prevents the device_name device from waking the computer from its sleep state.
Use powercfg /devicequery wake_armed to obtain the device_name.
/deviceenablewake device_name Allows the device_name device to wake the computer from its sleep state.
Use powercfg /devicequery wake_programmable to obtain the device_name.
/devicequery query_flag Displays devices that meet the query_flag.
Available flags are:
all_devices
all_devices_verbose
S1_supported
S2_supported
S3_supported
S4_supported
wake_armed
wake_from_any
wake_from_S1_supported
wake_from_S2_supported
wake_from_S3_supported
wake_programmable
/export scheme_name [/file filename] Exports the scheme_name power scheme and saves to the filename file.
Use powercfg /l to obtain the scheme_name.
/g on|off Turn a global power flag on or off.
The available global power flags are:
BatteryIcon - Display or hide the battery meter icon in the system tray.
MultiBattery - Turns the multiple battery display on or off in the system Power Meter.
ResumePassword - Enable or disable password prompt when resuming the computer from a sleep state.
VideoDim - Enable or disable support for dimming the computer display when running on battery power.
WakeOnRing - Enable or disable wake on ring support.
/h on|off Enable or disable hibernate mode on the computer.
/import scheme_name [/file filename] Import all power settings from the filename file to the scheme_name power scheme.
scheme_name is optional, and if omitted, a new power scheme is created.
The filename file is created by using the /export option.
Use powercfg /l to obtain the scheme_name.
/l Displays all power schemes for the current user's account.
/n A switch allowing a number to be used to specify a power scheme, in place of a scheme_name, for the /change, /d, /export, /import, /q, /s options.
/q scheme_name Displays contents of the scheme_name power scheme.
Use powercfg /l to obtain the scheme_name.
/s scheme_name Set the scheme_name power scheme to be active.
Use powercfg /l to obtain the scheme_name.
/? Displays all options for powercfg command.

Powercfg examples

Display a list of all power schemes on the computer.

powercfg /l

Display all settings for the power scheme with GUID of 381b4222-f694-41f0-9685-ff5bb260df2e.

powercfg /q 381b4222-f694-41f0-9685-ff5bb260df2e

Change the timeout value to 10 minutes for the monitor-timeout-ac setting of the currently active power scheme.

powercfg /x monitor-timeout-ac 10

Enable hibernate mode on the computer.

powercfg /h on

Set the power scheme with GUID of 381b4222-f694-41f0-9685-ff5bb260df2e to be the active power scheme.

powercfg /s 381b4222-f694-41f0-9685-ff5bb260df2e

Delete the power scheme with GUID of 381b4222-f694-41f0-9685-ff5bb260df2e.

powercfg /d 381b4222-f694-41f0-9685-ff5bb260df2e