This will only be of interest to those of you using high-CPU programs. I just made a very clever discovery that tied up the one loose end and figured it deserved a post.
This deals with taking a program that uses high CPU and lowering its 'priority' so it won't drag the system down, but will still hustle along as fast as it can otherwise. I suppose this is mainly for the field of video, because traditionally video conversion programs are power-hungry and slow, but it would relate to any CPU-hungry situation.
We'll be dealing with batch files, DOS, strings and variables.
Only the strong will survive.
Traditionally, the standard way to reduce a program's priority is to open Task Manager and right-click on the entry on the 'Processes' panel.
Mentally gagging at the mere thought of having to perform this hard manual labor, the next step is to automagically run the program via a batch file. You use the DOS 'Start' command to start the program with a low priority:
Start /LOW c:\video\coolprog.exe
And there ya go. Now it'll tool along in the background and be barely noticeable.
Step By Step
If you've never made a batch file before, here's how you do it:
— Open Notepad and scribble out your code. Save it wherever it goes.
— Change the file extension from ".txt" to ".bat". If you're not seeing file extensions, open Control Panel, Folder Options, the 'View' tab, uncheck 'Hide extensions...'.
Double-click on the file to run. If you want the DOS box to stay open after it's finished, put the DOS command 'Pause' on the last line.
When it's working, check the program's priority in Task Manager. Assuming it's 'Low', it's time for the finishing step:
— Grab the BAT icon with the mouse and d-r-a-g it over to the Start Menu and drop it in next to the original icon, then delete the original.
— Right-click on it, 'Rename', get rid of the ".bat".
— Open its 'Properties', set the 'Run' entry to 'Minimized'. That'll keep the ugly black DOS box from popping up. Then click on 'Change Icon' and browse to the original program, OK, OK, OK.
Problems in Happyland
The above works for four of the six video programs I want to tame. With the other two, I ran into very different problems:
— With Flash 8, the DOS box would just go blink! and the program wouldn't run. It would run straight from a DOS box, but not with the Start command.
— DVD Architect would fire right up, but with a normal priority.
And so over the years I've had to painstakingly, backbreakingly reset the priorities of those two programs manually via Task Manager. I've been thinking about writing a book on my travails.
Then the other day two of my brain synapses accidentally collided and I had a thought. I tried using the Start batch file to run another batch file. Such is the power and glory of random synaptic mutation.
And it worked! The first one, called "coolprog1.bat", reads:
Start /LOW coolprog2.bat
This does nothing but run another batch file named "coolprog2.bat", albeit this time with a low priority. The second one fires up the program:
"c:\video\cool prog\coolprog.exe"
Exit
This assumes both batch files are in the same folder. Note the path is in quotes because of the blank space; they're not necessary if there isn't. The 'Exit' command closes the DOS window after the program closes and the batch file continues.
As noted, this trick also worked for the program that ran fine but with a normal priority.
Any questions or additions, like usual, give a holler.