Powercfg
Introduction '''powercfg''' (executable name '''powercfg.exe''') is a command-line utility that is used from an elevated Windows Command Prompt to control all configurable power system settings, including hardware-specific configurations that are not configurable through the Control Panel, on a per-user basis. It was first introduced by Microsoft in Windows XP SP2 in 2004.
Usage powercfg must be run from an elevated command prompt, and, under Windows XP, it requires workstation Administrator or power user rights. Power Schemes are configured on a per-user basis. The most common cause of problems with power saving and hibernation on Windows systems is an incompatible device driver. This can be diagnosed by disabling each device in turn (with powercfg /devicedisablewake). When activating power saving across a local area network, it is important to ensure that software updates, security patches and antivirus updates in particular, are not disrupted. Microsoft recommends that its Windows Server Update Services be configured to install updates when workstations are available and Windows Task Scheduler can be set to wake the machine when needed.===Syntax===;XP:;Vista,  7:===Parameters=== Parameter Description OS XP Other/listLists all power schemes in the current user's environment./query ''scheme_name'' (XP)/query ''Scheme_GUID'' ''Sub_GUID''Displays the contents of the specified power scheme. ''scheme_name''''SCHEME_GUID'' (Optional) Specifies the ''scheme_name''/''GUID'' of the power scheme to display. ''GUID'' 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. Creates a power scheme with the specified ''scheme_name''./change ''setting'' ''value''/x ''setting'' ''value''Modifies a setting value in the current power scheme. ''setting''Specifies one of the following settings: monitor-timeout-ac minutesmonitor-timeout-dc minutesdisk-timeout-ac minutesdisk-timeout-dc minutesstandby-timeout-ac minutesstandby-timeout-dc minuteshibernate-timeout-ac minuteshibernate-timeout-dc minutesprocessor-throttle-ac throttleprocessor-throttle-dc throttle''value''Specifies the value in minutes. *AC settings are used when the system is on AC power. DC settings on battery power. *Setting any value to 0 will set the timeout=Never *throttle = NONE, CONSTANT, DEGRADE, or ADAPTIVE./changename ''GUID'' ''PowerSchemeName'' ''scheme_description''Modifies the name of a power scheme and, optionally, the scheme description.ValueDescription''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.ValueDescription''GUID''Specifies a scheme ''GUID''. Obtained by using the powercfg /l command. ''DestinationGUID''Specifies the ''GUID'' where the scheme will be copied.If  is omitted, then a new GUID will be created for the duplicated scheme./delete ''scheme_name'' /delete ''GUID''Deletes the power scheme with the specified GUID. ''scheme_name''''GUID'' Specifies the ''scheme_name''/''GUID'' of the scheme. ''GUID'' can be obtained by using the powercfg /l command./deletesetting ''Sub_GUID'' ''Setting_GUID''Deletes a power setting.ValueDescription''Sub_GUID''Specifies the subgroup ''GUID''. ''Setting_GUID''Specifies the power setting ''GUID''./setactive ''scheme_name''-setactive ''Scheme_GUID''Makes the specified power scheme active on the computer. ''scheme_name''''Scheme_GUID'' Specifies the scheme ''GUID''./getactiveschemeRetrieves 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.ValueDescription''Scheme_GUID''Specifies a power scheme GUID. Obtained by using the powercfg /l command. ''Sub_GUID''Specifies a subgroup of power setting GUID. Obtained by using the powercfg /q command. ''Setting_GUID''Specifies an individual power setting GUID. Obtained by using the powercfg /q command. ''SettingIndex'Specifies which of the list of possible values this power setting will be set to.Use the /l and /q options to discover the ''GUID''s/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.ValueDescription''Scheme_GUID''Specifies a power scheme GUID. Obtained by using the powercfg /l command. ''Sub_GUID''Specifies a subgroup of power setting ''GUID''. Obtained by using the powercfg /q command. ''Setting_GUID''Specifies an individual power setting''GUID''. Obtained by using the powercfg /q command. ''SettingIndex''Specifies which of the list of possible values this power setting will be set to./hibernate ''off''Enables or disables the hibernate feature. Hibernate timeout is not supported on all computers./numericalSpecify the power scheme to be operated upon with a numerical identifier. This switch allows a number to be used in place of the ''scheme_name'' in the following commands: /QUERY, /DELETE, /SETACTIVE, /CHANGE, /EXPORT, and /IMPORT/globalpowerflag ''off''Turn one of the following global power flags on or off:''BatteryIcon''Turn the battery meter icon in the system tray on/off. ''MultiBattery''Turns on/off multiple battery display in system Power Meter. ''ResumePassword''Prompt for password on resuming the system. ''WakeOnRing''Turn on/off wake on ring support. ''VideoDim''Turn on/off support for dimming video display on battery power./batteryalarm ''critical'' ''settings''Configure the battery alarm. Settings:/activate ''off''Enable or disable the alarm./level percentage (''0'' – ''100'')The alarm will be activated when the power level reaches this percentage./text ''off''Turns the text notification on or off./sound ''off''Turns the audible notification on or off./action ''standby''Specifies the action to take when this alarm goes off. Not all actions are always available./forceaction ''off''Force stand by or shutdown even if a program stops responding./program ''off''Specifies a program to run. schtasks.exe /change may be used to configure the program./availablesleepstatesReports 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 flags:''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./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./devicedisablewake 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 ''scheme_name'' /FILE ''filename''-import ''filename'' ''GUID''Imports all power settings from the specified file. ''filename'' Specifies a fully qualified path to a file generated by using the powercfg /export command-line option. ''GUID'' (optional) Represents the settings loaded into a power scheme. If not supplied, powercfg will generate and use a new GUID/export ''scheme_name'' /FILE ''filename''-export ''filename'' ''GUID''Exports a power scheme, represented by the specified GUID, to the specified file. ''filename'' Specifies a fully qualified path to a destination file. ''GUID'' Specifies a power scheme GUID. Obtained by using the /l command-line option./lastwakeReports information about the event that woke the computer from the last sleep transition./aliasesDisplays all aliases and their corresponding GUIDs. The user may use these aliases in place of any GUID at the command prompt/setsecruitydescriptor ''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 GUID. ''Action'' Specifies one of the following strings: ActionSetActive, ActionCreate, ActionDefault ''SDDL'' Specifies a valid security descriptor string in SDD format. Use powercfg /getsecuritydescriptor to see an example SDDL STRING./getsecuritydescriptor Gets a security descriptor associated with a specified power setting, power scheme, or action. GUID Specifies a power scheme or a power setting GUID. Specifies one of the following strings: ActionSetActive, ActionCreate, ActionDefault/requestsEnumerate application and driver Power Requests. Power requests prevent the computer from automatically powering off the display or entering a low-power sleep mode./requestsoverride ''Caller_type'' ''Name'' ''Request''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. NOTE: No documentation exists to remove a request override entry once entered, however leaving off the request type will do so. powercfg -requestsoverride ''Caller_type'' ''Name'' (Request left blank to remove entry)ValueDescription''Caller_type''Specifies one of the following caller types: PROCESS, SERVICE, DRIVER. This is obtained by calling the powercfg /requests command. ''Name''Specifies the caller name. This is the name returned from calling powercfg /requests command. ''Request''Specifies one or more of the following Power Request Types: Display, System, Awaymode  *Leave blank to remove an entry./energyAnalyzes 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. Windows 7 and certain Windows 10 Insider builds only.ValueDescription/output ''filename''Specifies the path and filename to store the energy report HTML file (default="energy-report.html")./xmlFormats the report file as XML./traceRecords 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. May only be used with the /trace parameter./duration Specifies the number of seconds to observe system behavior. Default is 60 secondsEnumerates the active wake timers. If enabled, the expiration of a wake timer wakes the system from sleep and hibernate states.Displays Help at the command prompt. ;Power scheme GUIDsThe use of GUIDs avoids any problems with internationalisation when applying Power Saving to non-English versions of Windows. The three built-in power schemes have the aliases listed below, which can be used instead of the GUIDs: *SCHEME_MAX = Power saver (Max power saving)*SCHEME_BALANCED = Balanced (Typical)*SCHEME_MIN = High performance (Min power saving)The other GUIDs have aliases as well.===Examples===Lists all power schemes powercfg /lList all Aliases powercfg -aliasesRetrieve the currently active power schemepowercfg -getactiveschemeSet the Monitor and disc timeouts for the current Power saver scheme powercfg -Change -monitor-timeout-ac 20powercfg -Change -disk-timeout-ac 30Enable the mouse to wake from sleep powercfg -deviceEnableWake "Microsoft USB IntelliMouse Explorer"Set the 'Power saver' scheme powercfg -SETACTIVE SCHEME_MAXCreate a Custom Power scheme and set it as active Set _Custom_Power=B1234567-SS64-SS64-SS64-F00000111AAApowercfg -DUPLICATESCHEME SCHEME_MAX %_Custom_Power%powercfg -CHANGENAME %_Custom_Power% "SS64 Power Scheme "powercfg -SETACTIVE %_Custom_Power%Disable the sleep button (for the users current power scheme) For /f "tokens=2 delims=:(" %%G in ('powercfg -getActiveScheme') do (  powercfg -setAcValueIndex %%G sub_buttons sButtonAction 0  powercfg -setActive %%G)Disable the sleep button (for all available power schemes) For /f "skip=2 tokens=2,4 delims=:()" %%G in ('powercfg -list') do (  powercfg -setAcValueIndex %%G sub_buttons sButtonAction 0  if "%%H" == " *" powercfg -setActive %%G)
See also *List of Control Panel applets (Windows)#Standard applets
References
Further reading *
External links **