This article is a mirror article of machine translation, please click here to jump to the original article.

View: 72|Reply: 2

[Tips] .NET/C# to set Windows Server power policy to high-performance mode

[Copy link]
Posted on3 days ago | | | |
Requirement: When using Windows Server to perform long-term complex calculations, switch the power mode to high-performance mode to improve performance; the default is balanced mode. Control Panel:Control Panel\All Control Panel Items\Power Options

The power plan consists of a set of power settings preferences. These preferences include AC and DC values for each power supply setting. Each power plan is identified by a unique GUID and a friendly name. Windows Vista has three default power plans: Power Saver, Balanced, and High Performance. These plans can be customized, and other plans can be created. All power plans have a personal attribute indicating the overall energy-saving behavior of the plan.

Display namedescriptionGUID
Power saverReduced performance is provided, which may increase energy savings.a1841308-3541-4fab-bc81-f71556f20b4a
BalanceAutomatically balances performance and energy consumption according to demand.381b4222-f694-41f0-9685-ff5bb260df2e
PerformanceDelivers optimal performance at the expense of higher energy consumption.8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

Power Strategy Settings:The hyperlink login is visible.

Hide power options

Microsoft has revealed a method to display all power options, although this method is in Powercfg/? There was no mention of it at all.

Just run it in PowerShellpowercfg /qhAll power options will obediently be printed. As shown below:



C# sets the power supply to high-performance mode. The code is as follows:
Reference:The hyperlink login is visible.




Previous:ASP.NET Core (35) https protocol monitors use PEM certificates
Next:Differences between glibc and musl standard libraries in the Linux environment
 Landlord| Posted on7 minutes ago |
Enable high-performance mode using the cmd administrator command:
 Landlord| Posted on45 seconds ago |
Windows 10 and 11 enable Ultimate Performance, with the following command:
Reference:The hyperlink login is visible.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com