This posts descripes how to change the power plan in Windows or a single option in a sheme from the Windows command line.
First of all start a cmd command shell with administrator rights.
To get a list of all available shemes run
c:\> powercfg /L
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)
The most options to powercfg at the command line must be specified with the GUID. To set the “High performance” plan active determine the sheme GUID and execute
c:\> powercfg /S 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
Query again und you see the other plan is active
c:\> powercfg /L
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)
Let us supose we only want to modify a single option or value. For example, disable the “Allow hybrid sleep” value in sheme “Power Saver” and with AC power active. Then, you first have to query all of the content of a sheme, because we need the GUID as parameter for powercfg. The output is a long list of options, I redirect them in a temporary file, because in the file it is easier to search for the necessary GUIDs.
c:\> powercfg /Q a1841308-3541-4fab-bc81-f71556f20b4a > %TEMP%\powercfg_output.txt
Extract the needed infos from the file:
....
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)
....
Subgroup GUID: 238c9fa8-0aad-41ed-83f4-97be242c8f20 (Sleep)
......
Power Setting GUID: 94ac6d29-73ce-41a6-809f-6363ba21b47e (Allow hybrid sleep)
Possible Setting Index: 000
Possible Setting Friendly Name: Off
Possible Setting Index: 001
Possible Setting Friendly Name: On
Current AC Power Setting Index: 0x00000001
Current DC Power Setting Index: 0x00000001
.....
This means GUID for sheme is a1841308-3541-4fab-bc81-f71556f20b4a, Subgroup GUID 238c9fa8-0aad-41ed-83f4-97be242c8f20, t 94ac6d29-73ce-41a6-809f-6363ba21b47e is the GUID of the option and the possible values are 0 or 1.
Lets set the value. Syntax for powercfg is
:: Usage: POWERCFG -SETACVALUEINDEX <SCHEME_GUID> <SUB_GUID>
:: <SETTING_GUID> <SettingIndex>
Run powercfg with the obtained data and the new value
powercfg -SETACVALUEINDEX a1841308-3541-4fab-bc81-f71556f20b4a 238c9fa8-0aad-41ed-83f4-97be242c8f20 94ac6d29-73ce-41a6-809f-6363ba21b47e 0
Query the content again
c:\> powercfg /Q a1841308-3541-4fab-bc81-f71556f20b4a > %TEMP%\powercfg_output.txt
....
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)
....
Subgroup GUID: 238c9fa8-0aad-41ed-83f4-97be242c8f20 (Sleep)
......
Power Setting GUID: 94ac6d29-73ce-41a6-809f-6363ba21b47e (Allow hybrid sleep)
Possible Setting Index: 000
Possible Setting Friendly Name: Off
Possible Setting Index: 001
Possible Setting Friendly Name: On
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000001
.....
Thats it. You also can modify values in shemes that are currently inactive, of course.
Michael