Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to change Windows process priority via command line.

How can I do that?

share|improve this question

5 Answers 5

up vote 9 down vote accepted
+100

The command line syntax:

wmic process where name="AppName" CALL setpriority ProcessIDLevel

Example:

wmic process where name="calc.exe" CALL setpriority 32768

or

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

Priority:

idle: 64

below normal: 16384

normal: 32

above normal: 32768

high priority: 128

real time: 256

share|improve this answer
    
You can also do wildcards wmic process where "CommandLine like '%calc%'" CALL setpriority "below normal" –  laggingreflex Feb 16 at 17:59
    
Its possible to do the same for Background(low IO and memory priority) like in Process Explorer? –  miky Aug 5 at 8:53

A small addition.

You can also use string values instead of integers (easier to memorize) like that:

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

Possible values: "idle", "low", "below normal", "normal", "above normal", "high priority", "realtime"

PS. Don't forget the quotes, especially if using multiple words in a string value

share|improve this answer

In response to laggingreflex who currently has set an open bounty, stating that the accepted answer does not work:

It does work in Windows 8. Check in Task Manager, or restart Process Explorer.

You may have found a bug/deficiency in Process Explorer.

share|improve this answer
    
    
I understand that that's not anyone else's problem but mine. Guess I'll open another question and reward the bounty to current correct answer anyways. –  laggingreflex Feb 11 at 10:26
    
@laggingreflex: Verified as working on Windows 8.1 - see proof. Are you sure you have run the command prompt as Administrator? –  harrymc Feb 11 at 13:33
    
I did. My wmic is malfunctioning I guess. I've opened a question about that separately.. In the hindsight I should've confirmed more before. –  laggingreflex Feb 11 at 13:45
    
@laggingreflex: The logon account being Administrator is not enough - you should still use Run as Administrator. The easiest way is to press Win-R and type cmd followed by Shift-Enter. –  harrymc Feb 11 at 14:11

In addition to existing answers, the thread Windows Equivalent of 'nice' lists some more solutions :

  1. Using the command START in the command-prompt (CMD).
  2. Using the free ProcessTamer to set up a rule on the .exe that is automatically enforced whenever that process is started.
  3. Using a PowerShell script contained here.
  4. Using a VBScript contained here.

Additionally, the old SetPriority utility might still work, but I haven't tried it for many years now.

Some of these solutions may not work on system services or may need to be Run as Administrator.

share|improve this answer

From batch command line I would simply use powershell. This example starts calc.exe, finds it's process and adjusts it priority class to "IDLE" aka LOW.

start /b /wait powershell.exe -command "calc.exe;$prog = Get-Process -Name calc;$prog.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::IDLE"

Specify one of the following enumeration values "Normal, Idle, High, RealTime, BelowNormal, AboveNormal"

Here is the same thing from powershell with split lines.

calc.exe
$prog = Get-Process -Name calc
$prog.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::IDLE
share|improve this answer
    
What's the point of repeating what was already said before? –  harrymc Feb 12 at 15:15
    
@harrymc It answers the original question, using PowerShell. –  paradroid Feb 12 at 17:00
    
@harrymc - actually I am repeating what I said from DEC. stackoverflow.com/questions/20693028/… –  Knuckle-Dragger Feb 15 at 16:41
    
No problem. Just that I linked to something pretty similar. –  harrymc Feb 15 at 17:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.