Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Instant process priority alteration


  • Please log in to reply
No replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
To instantly give an application more CPU time to make it faster, or to make it a low priority so as it uses CPUonly when its available use this script.

I used to alter priorities for tasks like Divx compression, making it low priority and using my computer normally so as to allow it to use only freely available CPU time and not hog it when its required by other active tasks.

call it using a hotkey from your 24/7 script or turn it into a hotkey function.
(uses the new process cmd)

; allows cmd line params to be sent
; script.ahk PID

IfEqual, 1,, WinGet, curr_pid, PID, A
Else SetEnv, curr_pid, %1%

        
Menu, priority, add, Realtime, Change_Priority
Menu, priority, add, High, Change_Priority
Menu, priority, add, Above Normal, Change_Priority
Menu, priority, add, Normal, Change_Priority
Menu, priority, add, Below Normal, Change_Priority
Menu, priority, add, Low, Change_Priority
Menu, priority, add        
Menu, priority, add, Kill Process, Kill_Process

Menu, priority, show        

Exit

Change_Priority:
        StringLeft, new_priority, A_ThisMenuItem, 1
        Process, Priority, %curr_pid%, %new_priority%
Return

Kill_Process:
        Process, Close, %curr_pid%
Return

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat