Change process’s priority in Windows

The simplest means to do this is by simply opening Task Manager in Windows and navigating to the Details pane. Right-click on a process in the list, then select Set priority from the menu.

Alternatively, similar to the Linux renice command, the priority can also be set via command-line in Windows using

wmic process where name="devenv.exe" CALL setpriority "high priority"Code language: JavaScript (javascript)

The aforementioned methods will not persist upon system restart. Permanently setting the default priority of a process can be achieved using a registry script. This file can contain as many entries as desired. In this example below, I set the default process priority of devenv.exe and sqlservr.exe to High 00000003:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe\PerfOptions] 
"CpuPriorityClass"=dword:00000003

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sqlservr.exe]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sqlservr.exe\PerfOptions] 
"CpuPriorityClass"=dword:00000003

Leave a Reply