Jump to content

ProcessSetPriority for all PID sharing the same Process Name

Recommended Posts

Needed a way to set the process priority of all processes with the same name, the current ProcessSetPriority only sets the first result found. If you are trying to use this on a multiprocess app like Chrome.exe, then more than likely it will set the priority on the wrong PID. This version sets all PID with the same Process Name instead of just the first one. 

#RequireAdmin;Probably required for Vista/7+
ProcessSetPriorities("chrome.exe", 3);Example execution.

Func ProcessSetPriorities($Process, $priority);Same as ProcessSetPriority, except it sets all processes with the process name, instead of the first one found.
    Global $Processes = ProcessList($Process);get Multiple Processes
    For $i = 1 To $Processes[0][0]; For Each found unique PID
        ProcessSetPriority($Processes[$i][1], $priority);Set Priority
EndFunc   ;==>ProcessSetPriorities


False Positive Reporter - Mass email all anti-virus vendors with an attachment of your program for fast and easy whitelisting.

RollbarSDK UDF - Provides real-time error alerting & debugging tools for developers. 


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...