Power configuration management using powercfg
Modifying the Active Power Plan:
Utilize the powercfg command to adjust various timeouts, such as monitor, disk, standby, and hibernate. For instance, setting the monitor timeout to 15 minutes when plugged in can be achieved with
1 2 3 4 5 6 7 8 | powercfg -change -monitor-timeout-ac 15 powercfg -change -monitor-timeout-dc 15 powercfg -change -disk-timeout-ac 0 powercfg -change -disk-timeout-dc 0 powercfg -change -standby-timeout-ac 0 powercfg -change -standby-timeout-dc 0 powercfg -change -hibernate-timeout-ac 0 powercfg -change -hibernate-timeout-dc 0 |
0 = Never
https://github.com/DavidWuibaille/Repository/tree/main/Windows/Windows11/Powercfg
Switching Power Modes:
View and set the desired power scheme. For example, to activate the high-performance mode, use the command
1 | powercfg /LIST |
Set the power scheme
1 2 3 4 5 | :: Normal usage Powercfg -setactive 381b4222-f694-41f0-9685-ff5bb260df2e :: High performance powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c |
Advanced Power Settings:
To configure specific actions like the lid close action, use the powercfg command with the appropriate GUIDs. For instance, to set the lid close action to “Sleep” when on battery, use the provided commands.
1 | powercfg /QUERY |

1 2 3 4 5 6 7 | :: Lid close action Powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0 Powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 1 ::0 Do nothing ::1 Sleep ::2 Hibernate ::3 Shut down |
We will have :
- setacvalueindex => for power management
- setdcvalueindex => for battery management
USB Power Management:
To ensure that USB devices remain active and don’t enter a power-saving mode, disable USB power management using the powercfg command.

1 2 | powercfg /SETDCVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0 powercfg /SETACVALUEINDEX SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0 |
0 Comments