I would like to know how to change the power plan
in Windows 7 to high performance using a batch file. I am making a program that boosts pc performance.
4 Answers
I found this.
@echo off
powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
pause
-
"381b4222-f694-41f0-9685-ff5bb260df2e" is balanced power plan. For high performance (as asked by the OP), "8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c" should be used instead.– user274116Dec 11, 2013 at 11:55
-
1
-
-
1@09stephenb
To determine the GUID for all existing power schemes, type Powercfg /List at the command prompt, and then press ENTER
.– AminMMar 31, 2014 at 13:06 -
for auto closing of the CMD window, just make a BAT file with powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c in it only. It will auto close, don't need echo off or Pause commands in there.
As an alternative to the other answers on this page you could use the aliases, which is a bit more readable. here is a description of the powercfg command. When run with the aliases option, it will show all active aliases. The aliases for the default plans are:
scheme_max, power saver
scheme_min, high performance
scheme_balanced, balanced
So then you would use it as such: powercfg -setactive scheme_min
-
Could you include an example of how OP might use the powercfg command and aliases to change his power plan to High Performance? Jan 30, 2017 at 23:08
-
1@music2myear That was the example I already included, but I adjusted the markup to make it more clear.– BerendFeb 6, 2017 at 16:28
The currently selected power plan can be set using the powercfg
command, which can be included in any .bat/.cmd/.ps1 file where you might need to do so. For example:
powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
GUID 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
corresponds to the High Performance
scheme.
To find the correct GUID for the power plan you want to select, you can use the -list
option, e.g.:
C:\WINDOWS\system32>powercfg -list Existing Power Schemes (* Active) ----------------------------------- Power Scheme GUID: 110782a4-72aa-47dd-bec2-293ec84ce5b7 (Keep Screen On) Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) * Power Scheme GUID: 3aaca180-95bf-47c2-b285-8ecb240364e8 (Never Sleep)
This will show you all custom plans. A built-in plan is shown only if it's the plan currently selected. For built-in plans, you can look at the plan aliases. The powercfg
command defines aliases for the GUIDs that can be specified as an argument in place of a GUID. E.g.:
C:\WINDOWS\system32>powercfg -s scheme_min
You can find out what these aliases are with the -alias
option, e.g.:
C:\WINDOWS\system32>powercfg -aliases a1841308-3541-4fab-bc81-f71556f20b4a SCHEME_MAX 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c SCHEME_MIN 381b4222-f694-41f0-9685-ff5bb260df2e SCHEME_BALANCED e73a048d-bf27-4f12-9731-8b2076e8891f SUB_BATTERY 637ea02f-bbcb-4015-8e2c-a1c7b9c0b546 BATACTIONCRIT d8742dcb-3e6a-4b3c-b3fe-374623cdcf06 BATACTIONLOW 5dbb7c9f-38e9-40d2-9749-4f8a0e9f640f BATFLAGSCRIT . . . 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e VIDEOIDLE
The SCHEME_...
aliases correspond to the power plans (the other aliases correspond to other values that might be passed as arguments to other powercfg
command invocations).
NOTE: as noted earlier, the GUID values available via alias are not necessarily the same shown in the -list
option. The -list
GUIDs shown will be only any user-defined schemes, plus the currently-active scheme if that scheme is one of the Windows default/built-in schemes. Inactive built-in schemes are not shown (presumably to simplify the output).
On the other hand, -aliases
shows all defined aliases for the powercfg
command, which are only defined for the built-in schemes. There won't be any aliases for user-defined schemes.
For now, this shouldn't be a problem as all of the built-in plans have aliases and so will show up when using the -aliases
option. But if Microsoft ever adds a built-in plan for which they don't define an alias, you can learn the GUID simply by selecting that plan and then using the -list
option.
Finally note that the alias names relate to the aggressiveness of power saving, not the computer performance. I.e. the SCHEME_MIN
alias is the one that corresponds to the High Performance
scheme, while SCHEME_MAX
corresponds to Power Saver
.
(I realize this answer may seem to reiterate information from some of the other answers. And it does. But none of the answers are comprehensive, and it is more useful to have a single answer that provides all of the information one might need. I tried to improve the accepted answer by editing it, but the Superuser community did not appreciate that and rejected the edit. So I am posting my own answer to provide that single comprehensive answer that the question deserves.)