windows通过命令行设置进程优先级
针对进程的就通过这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 |