1

Over the last few days I have been converting old video files from avi to mp4. I've been doing this using the command line version of DivX. This is the process behing the DivXPro GUI and it is named DivXEngine.exe. Converting video files takes a big hit on the CPU and I would prefer to set the process to a lower priority to minimize the impace on my usual tasks. Under Windows 7 there was a utility program that could be used to permanently change a task priority. Unfortunately it no longer works in Windows 10 so I did the next best thing. I coded up a simple script that I could run in the background. Every 10 seconds it resets the priority of the divX process to "below normal". Naturally I use a script to process each of my videos in turn, and after each conversion, a new instance of DivXEngine.exe is created. My ten-second loop script then whacks the new instance back to "below normal".

The tool that accomplishes the priority change is wmic.exe which comes with Windows 10. I am just starting to explore what can be done with wmic. If uou have a process that you need to puch to the back, try wmic and the above script.

Edited by Reverend Jim

Votes + Comments
"Maximum warp Scotty!"
'Priority values are
'
'   idle:                4 (this displays as "low" in Task Manager)
'   below normal:        6
'   normal:              8
'   above normal:       10
'   high priority:      13
'   real time:          24
'
'You can use % as a wildcard in the process name as in "%divx%"

Const PROCESS  = "DivXEngine.exe"
Const PRIORITY = "below normal" 

Set wso = CreateObject("Wscript.Shell")
cmd = "wmic process where name=""" & PROCESS & """ call setpriority """ & PRIORITY & """"

Do While True
    wso.Run cmd,0,True      'run hidden and wait for completion
    WScript.Sleep 10000     'sleep for 10 seconds
Loop

Computer languages in which I have developed applications

Assembler (DEC, Data General, 8080, GE, SEL, IBM 360)
WATFOR (Waterloo FORTRAN)
FORTRAN (SEL)
APL (IBM 360, IBM VSAPL)
PL/1
C/C++
Borland Paradox
VB.net
vbScript

1
Contributor
0
Replies
9
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.