Sheduled Task Process Priority

Process Priority is everything.

Did you know that the default Process Priority of a scheduled Task in Windows is below normal?
No? me either.

You may know the following scenario. You have a few scheduled Task like a daily Robocopy job, and you are wondering why the run time is growing every day.
We had that problem too. Our Problem was that a Robocopy Process took more than 2 Days to mirror just a bunch of folders on our Fileserver.

The Problem was, that every night when our Robocopy Process was running, a second Indexing Process from a third party tool came up, to update its Database by re-indexing the fileserver folders. During that time, the Robocopy Process was nearly on hold.

But why? After a few tests i saw that the Robocopy Process was started with a lower Priority than normal. Our Robocopy Process was waiting until it got some free Resources from our System.

I didn’t know that Windows set the Default Process Priority from a scheduled Task to “Below Normal”.
I also checked inside the Windows Task Scheduler if i could change the Priority Level,  but there is no way to override this from the Task Scheduler GUI.

The solution is quite simple.

So there is no way to change the Priority level inside the GUI. The only possibility to do that is to Export your Scheduled Task as an XML file.
Open that file with an Text Editor and search for the “Priority Key” value in it.
This value is set to “7” by default, and 7 means “Below Normal”(see List)

Task priorityPriority ClassPriority Level
0REALTIME_PRIORITY_CLASSTHREAD_PRIORITY_TIME_CRITICAL
1HIGH_PRIORITY_CLASSTHREAD_PRIORITY_HIGHEST
2ABOVE_NORMAL_PRIORITY_CLASSTHREAD_PRIORITY_ABOVE_NORMAL
3ABOVE_NORMAL_PRIORITY_CLASSTHREAD_PRIORITY_ABOVE_NORMAL
4NORMAL_PRIORITY_CLASSTHREAD_PRIORITY_NORMAL
5NORMAL_PRIORITY_CLASSTHREAD_PRIORITY_NORMAL
6NORMAL_PRIORITY_CLASSTHREAD_PRIORITY_NORMAL
7BELOW_NORMAL_PRIORITY_CLASSTHREAD_PRIORITY_BELOW_NORMAL
8BELOW_NORMAL_PRIORITY_CLASSTHREAD_PRIORITY_BELOW_NORMAL
9IDLE_PRIORITY_CLASSTHREAD_PRIORITY_LOWEST
10IDLE_PRIORITY_CLASSTHREAD_PRIORITY_IDLE

Source: Microsoft MSDN

Just change the Value to 5 or below to set the Process to a Normal or High Priority. After you saved the XML File, just import it into the Windows Task Scheduler. After makting these changes, our Robocopy finished its job during 2 hours.

I have no clue why Microsoft haven’t made a simple Filed inside the GUI to change the Process Priority.
It could be so easy.

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.