[Windows] Batch script example to change "Power Options" to "High Performance" or "Ultimate Performance"

Windows

Hello!Today is Windows "Power optionsToHigh performance"Or"Ultimate performanceI will introduce an example of a batch file to be changed to.

Do you usually use a computer and say, "I bought an expensive computer, but it's slow ..." or "I want to move it more quickly!"?In such a case, you can bring out the original specifications of your computer to some extent by setting it to the "power option" that emphasizes performance.

In fact, it may be a computer that has higher settings and can use what is called "ultimate performance". I'm sure some of you may be wondering, "I know high performance, but is it the ultimate performance?"

"Ultimate performance" is provided for workstations and some high-spec PCs, but I also tried to make it possible to check if it exists.

This time, I would like to introduce an example of creating a batch file that changes such performance. Please try the batch file that may make your PC crispy.

* Depending on how you use it, the hardware may be overloaded and its life may be shortened.Please use it with sufficient care after understanding.

Thing you want to do

Part XNUMX: I want to change "Power Options" to "High Performance" by executing a batch file.

Part XNUMX: I want to change "Power Options" to "Ultimate Performance" by executing a batch file.

Script example

Change to "high performance"

rem 高パフォーマンスに設定する
powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

Change to "ultimate performance"

rem 電源プランの選択肢に既に究極のパフォーマンスがある場合、設定して終了する
for /f "tokens=3 usebackq" %%A in (`powercfg list ^| find /i "究極のパフォーマンス"`) do if not "%%A"=="" powercfg /s %%A & exit

rem 電源プランの選択肢にない究極のパフォーマンスがない場合は、追加した上で設定して終了する
for /f "tokens=3 usebackq" %%B in (`powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61`) do powercfg /s %%B & exit

How to use

1. Paste the above code into a text editor etc.

2. Give a suitable name and save with the extension ".bat"

3. Right-click the completed batch file and click "Execute with administrator privileges" to execute it.

Commentary

Batch to set high performance

First of all, "high performance".High performance is a power setting (: profile) that brings out the performance of the hardware while ignoring power saving.By setting this, excessive power saving = performance will not be suppressed, so performance may improve to some extent.

powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

"powercfgThe "command" is a command for setting the power plan of Windows./sIs an option to change the power plan to the specified one.

"8c5e7fda-e8bf-4a96-9a85-a6e23a8c635cIs a GUID that stands for "high performance".

in short,"Change power plan to high performanceIt becomes a command.

The GUID is a cluttered string, but it seems to be a common value on most Windows.If you want to see other power profiles, you can get a list with "powercfg / list", so you may want to take a look.

Power profile example

Batch to set if ultimate performance exists

for / f "tokens = 3 usebackq" %% A in (powercfg list ^| find /i "究極のパフォーマンス") do if not "%% A" ==" "powercfg / s %% A & exit

This will change the power plan if "ultimate performance" exists in the power plan options.

"powercfg / listDisplays a list of power plans that can be currently selected with "", and from there "find / i "ultimate performance"I have selected only the "Ultimate Performance" GUID.

After that, if you can get the GUID (if not "%% A" =="), Change the power plan to that GUID (powercfg / s %% A)doing.

in short,If "ultimate performance" already exists in the power plan optionsChangeToIt becomes a command.

for / f "tokens = 3 usebackq" %% B in (powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61) do powercfg / s %% B & exit

This will only be done if there is no "ultimate performance" in the power plan choices.

"powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61, Newly added "Ultimate Performance" to the plan options, and then changed the power plan to "Ultimate Performance".

Why is the for statement appearing?For more information, please see below ♪

You need it when you want to use the output result of executing one command as an option for another command.

* This time, the GUID of the power plan is used to use "powercfg / s 〇〇" to set the power plan.

Afterword

This time, I introduced an example of creating a batch file that changes the "power plan" to "high performance" or "ultimate performance".

In the "Balance" setting, etc., a slight delay may occur due to the processing of the function to reduce the "power consumption". "High performance" and "ultimate performance" have the effect of suppressing the delay, so it is often possible to maximize the performance of the personal computer.

In addition, the "powercfg" command has many functions other than those introduced above.

Functions such as "What percentage of power is the CPU currently running?", "Time to sleep when left unattended", and "I want to apply finely set power settings to other PCs!" There are also, so I would like to introduce them in other articles!

I hope it helps you.

Comment

Translate »
I copied the title and URL