Created
December 9, 2019 06:35
-
-
Save lancepioch/215620812e11b8eb915f96fea7b9230e to your computer and use it in GitHub Desktop.
Adjust priorities for MW and Discord to fix voice issues and lag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wmi, win32api, win32process, win32con | |
priorityclasses = [win32process.IDLE_PRIORITY_CLASS, | |
win32process.BELOW_NORMAL_PRIORITY_CLASS, | |
win32process.NORMAL_PRIORITY_CLASS, | |
win32process.ABOVE_NORMAL_PRIORITY_CLASS, | |
win32process.HIGH_PRIORITY_CLASS, | |
win32process.REALTIME_PRIORITY_CLASS] | |
# "Recipe 496767: Set Process Priority In Windows" on ActiveState - http://code.activestate.com/recipes/496767/ | |
for process in wmi.WMI().Win32_Process(): | |
if (process.Name == "Discord.exe"): | |
print(process.ProcessId, process.Name) | |
handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, process.ProcessId) | |
win32process.SetPriorityClass(handle, win32process.HIGH_PRIORITY_CLASS) | |
if (process.Name == "ModernWarfare.exe"): | |
print(process.ProcessId, process.Name) | |
handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, process.ProcessId) | |
win32process.SetPriorityClass(handle, win32process.ABOVE_NORMAL_PRIORITY_CLASS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment