当您在Windows系统中运行应用程序时,它们都共享您的处理器资源来运行。优先级决定了正在运行的应用程序使用的处理器资源的数量。
Windows应用程序和进程的优先级基于以下级别:
- 即时的。
- 高的。
- 超出正常水平。
- 普通的。
- 低于一般。
- 低的。
分配给进程的优先级越高,它使用的处理器资源就越多;因此,使用该进程的应用程序的性能越好。
Windows系统会自动为正在运行的进程分配优先级,但您可以手动更改优先级。本指南将向您展示执行此操作的三种方法。
请注意,虽然您可以轻松设置进程优先级,但这只是暂时的,因为当您关闭程序或重新启动计算机时,进程会恢复到其默认优先级。
如何在Windows 10中更改进程优先级(Windows 10)
有三种方法可以更改机器上运行的进程的优先级。您可以使用以下方法执行此操作:
- 在任务管理器(Task Manager)中更改优先级。
- (Set)使用PowerShell(PowerShell)设置进程优先级。
- (Set)使用命令提示符(Command Prompt)设置优先级。
继续阅读以了解如何在不遇到严重并发症的情况下执行上述操作。
1]在任务管理器中(Task Manager)更改(Change)优先级
在任务管理器中设置优先级右键单击(Task ManagerRight-click)开始按钮(Start)并选择任务管理器(Task Manager)。单击(Click)任务管理器(Task Manager)屏幕 底部的向下箭头以获取更多详细信息(More details)。
切换到 窗口顶部的详细信息选项卡。(Details)在这里,找到您希望更改其优先级的进程并将鼠标悬停在 Set priority上。
从上下文菜单中,选择所选应用程序或进程的优先级。您可以在给定的优先级之间进行选择。
点击 更改优先级(Change priority)按钮并关闭任务管理器。
2]使用PowerShell设置(Set)进程优先级
与任务管理器(Task Manager)方法不同,PowerShell没有用英文命名优先级。相反,您必须使用指定的ID(IDs)设置优先级。
下表显示了各种优先级及其对应的 ID:
Priority Level | Corresponding ID |
Realtime | 256 |
High | 128 |
Above normal | 32768 |
Normal | 32 |
Below normal | 16384 |
Low | 64 |
话虽如此,请按照以下步骤使用PowerShell(PowerShell)更改程序/进程优先级。
按(Press)Windows键并搜索PowerShell。从搜索结果中单击该程序。(Click)
在PowerShell窗口中,输入以下命令并按 ENTER(ENTER)。
Get-WmiObject Win32_process -filter 'name = "ProcessName.exe"' | foreach-object { $_.SetPriority(PriorityLevelID) }
在上面的命令中,将 ProcessName替换为您希望更改其优先级的进程或应用程序的名称。
同样,将PriorityLevelID更改为优先级编号。
3]使用命令提示符(Command Prompt)设置(Set)优先级
按Windows key + R组合以调出“运行”(Run)对话框。在这里,输入 cmd并按 ENTER。
在命令提示符(Command Prompt)窗口中,输入以下命令并按ENTER。
wmic process where name="ProcessName" CALL setpriority "PriorityLevelID"
注意: (NOTE: )在上述命令中,将 ProcessName替换为要更改其优先级的进程的名称。
此外,使用此命令执行此操作(如在PowerShell中)使用指定的优先级ID(IDs)。因此,在输入上述命令时,请务必将PriorityLevelID替换为上一个解决方案中表中对应的 ID。
如果您希望像我们在任务管理器(Task Manager)方法中那样使用实际的优先级名称,您可以使用下面的命令。
wmic process where name="ProcessName" CALL setpriority "PriorityLevelName"
对于此命令,请记住还将 ProcessName替换为应用程序/进程的名称,并将 PriorityLevelName替换为您要使用的优先级(Realtime、High、Above normal 、Normal、Below Normal或Low)。
注意(NOTE):
- 这篇文章将向您展示如何保存进程优先级
- 如果您无法在任务管理器中设置进程优先级,(can’t set Process Priority in Task Manager)请参阅此帖子。
了解了在Windows 10中设置进程优先级的三种方法后,我必须警告您不要将程序设置为 实时(realtime)优先级。这使进程可以使用最大数量的资源,并且会妨碍其他应用程序的性能。
Change Process Priority for running processes using Command line
When you run applications in your Windows system, they all share yoυr proceѕsor resources to operаte. The priorіty level determineѕ the number of processоr resources a running application uses.
Windows applications and processes are prioritized based on the following levels:
- Realtime.
- High.
- Above normal.
- Normal.
- Below normal.
- Low.
The higher up the priority level assigned to the process, the more processor resources it uses; hence, the better the performance of the application using the process.
The Windows system automatically assigns the priority levels to the running processes based, but you can change the level manually. This guide will show you three ways to carry out this operation.
Note that although you can easily set process priorities, it’s only temporary because the process reverts to its default priority level when you close the program or reboot your computer.
How to change the process priority level in Windows 10
There are three ways to change the priority level of processes running on your machine. You can do this using the following methods:
- Change the priority in Task Manager.
- Set the process priority using PowerShell.
- Set the priority level using Command Prompt.
Read on to learn how to carry out the above operations using without running into serious complications.
1] Change the priority in Task Manager
To set the priority in Task ManagerRight-click on the Start button and select Task Manager. Click on the downward-facing arrow at the bottom of the Task Manager screen for More details.
Switch to the Details tab at the top of the window. Here, find the process for which you wish to change its priority and hover on Set priority.
From the context menu, select the priority level for the chosen application or process. You can choose between the given priority levels.
Hit the Change priority button and close the Task Manager.
2] Set the process priority using PowerShell
Unlike in the Task Manager method, PowerShell doesn’t name the priority levels in English terms. Instead, you have to set the priority level using designated IDs.
The table below shows the various priority levels and their corresponding IDs:
Priority Level | Corresponding ID |
Realtime | 256 |
High | 128 |
Above normal | 32768 |
Normal | 32 |
Below normal | 16384 |
Low | 64 |
With that said, follow the steps below to change program/process priority levels using PowerShell.
Press the Windows key and search for PowerShell. Click on the program from the search results.
In the PowerShell window, enter the following command and hit ENTER.
Get-WmiObject Win32_process -filter 'name = "ProcessName.exe"' | foreach-object { $_.SetPriority(PriorityLevelID) }
In the command above, replace ProcessName with the name of the process or application for which you wish to change its priority level.
Similarly, change PriorityLevelID to the priority level number.
3] Set the priority level using Command Prompt
Press the Windows key + R combination to bring up the Run dialog box. Here, type in cmd and press ENTER.
In the Command Prompt window, enter the command below and press ENTER.
wmic process where name="ProcessName" CALL setpriority "PriorityLevelID"
NOTE: In the above command, replace ProcessName with the name of the process whose priority level you want to change.
Also, performing this operation with this command, like in PowerShell, uses the designated priority level IDs. So, when inputting the command above, be sure to replace PriorityLevelID with the corresponding ID from the table in the previous solution.
If you wish to make use of the actual priority level names as we did in the Task Manager method, you can use the command below.
wmic process where name="ProcessName" CALL setpriority "PriorityLevelName"
For this command, remember to also replace ProcessName with the name of the application/process, and PriorityLevelName with the priority level you want to use (Realtime, High, Above normal, Normal, Below Normal, or Low).
NOTE:
Having learned the three ways to set process priority levels in Windows 10, I must warn you against putting programs to the realtime priority level. This lets the process use the maximum amount of resources and will hamper the performance of other applications.