windows通过命令行设置进程优先级

2022-04-28 18:31:57 浏览数 (1)

针对进程的就通过这6个优先级来控制

图形界面可以通过任务管理器操作,也可以通过其他软件

cmd命令行示例:

wmic process where name="process name" CALL setpriority "value"

wmic process where name="firefox.exe" CALL setpriority "realtime"

wmic process where name="firefox.exe" CALL setpriority "high priority"

wmic process where name="firefox.exe" CALL setpriority "above normal"

wmic process where name="firefox.exe" CALL setpriority "normal"

wmic process where name="firefox.exe" CALL setpriority "below normal"

wmic process where name="firefox.exe" CALL setpriority "idle"

powershell命令行示例:

Get-WmiObject Win32_process -filter 'name = "ProcessName"' | foreach-object { $_.SetPriority(PriorityLevelID) }

例如:Get-WmiObject Win32_process -filter 'name = "firefox.exe"' | foreach-object { $_.SetPriority(32768) }

Priority Level ID

Priority Level Name

256

Realtime

128

High

32768

Above normal

32

Normal

16384

Below normal

64

Low

参考:

https://superuser.com/questions/620724/changing-windows-process-priority-via-command-line

http://gilchrist.ca/jeff/SetPriority/

https://www.tenforums.com/tutorials/89548-set-cpu-process-priority-applications-windows-10-a.html

0 人点赞