Rick
asked on
Set Windows Process Priority through VB?
Hello,
Is there a way to set a windows process priority through VB (lower/higher its priority)?
What if there are two processes with the same name?
For example, two instances of ms word (winword)?
Thanks,
Rick
Is there a way to set a windows process priority through VB (lower/higher its priority)?
What if there are two processes with the same name?
For example, two instances of ms word (winword)?
Thanks,
Rick
ASKER
I'm using VB 08, but I will take the answer in any version.
Thanks,
Rick
Thanks,
Rick
Here's some example code, I hope it helps you.
Kind regards,
Matthias Vance
Kind regards,
Matthias Vance
Private Sub SetProcessPriority(ByVal processName As String, ByVal priority As ProcessPriorityClass)
Dim pl() As Process = Process.GetProcessesByName(processName)
For Each p As Process In pl
p.PriorityClass = ProcessPriorityClass.High
Next
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent job!
Thank you,
Rick
Thank you,
Rick
Kind regards,
Matthias Vance