Windows Tip: Launching a low priority process

3 comments | 5I like it!
August 11, 2006, 01:28 PM —  ITworld.com — 

Send your Windows question to Mitch today!


See other Windows tips


A friend of mine who is a petroleum engineer recently told me about a problem he was having. He was launching a series of batch jobs (big simulation jobs) on his Windows XP workstation from the command line by running a batch file that contained a series of commands like job5.exe -i input.dat, and his problem was that these jobs were hogging so much of his machine's processing power that foreground tasks became unresponsive. Once these processes were running however, he could open Task Manager and change their priority to Low, and then he could work normally on the machine while the jobs ran in the background. He was wondering if there was a way to start an application with Low priority instead of Normal.



It turns out there are several solutions to this problem. A simple approach is to use the start command to launch each job with Low priority as follows:

start /low /b job5.exe -i input.dat

The /b switch causes the job to run in the current command window but with Low priority. Another solution would be:

start "Job #1" /low job5.exe -i input.dat

This runs the job in a separate command window with "Job #1" in the title bar to distinguish it from the spawning command window in which the batch file itself runs. Still another solution is to do this:

start "Low cmd" /low cmd.exe

This opens a new command window where the cmd.exe process has Low priority and the window's title bar displays "Low cmd." Once this new command window is open, you can run your batch file in it and all jobs spawned by the batch file will run with Low priority also. Still another variation of this is:

start /low /b cmd.exe

This runs a second cmd.exe process with Low priority within your visible Normal priority command window, and again running the batch file will launch all your jobs with Low priority.

Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world

I like it!
Comments

Parameters

Please show an example of how to launch a command in low priority where the command includes parameters that must be specified in quotes (e.g. parameters that are filenames with spaces)
| reply

Yes please.

Yes please.
| reply

Solution

OK, the solution to the first poster's problem is to put some text (it doesn't matter what) in quotes before any of the other quoted stuff. As good a place as any to put it is right after the START clause.

The reason is that the START command automatically assumes the first quoted string is the name you want to give the new window. Regardless of whatever the first quoted string is actually supposed to do.

Bad design decision on Microsoft's part. They should have made it so that the name of the new window follows an actual flag. But they didn't. So we have to fix their mistake.
| reply
peer-to-peer

Esther Schindler
If the comments are ugly, the code is ugly

claird
SVG a graphics format for 21st century

pasmith
Take Chrome OS for a test spin

Sandra Henry-Stocker
Solaris Tip: Have Your Files Changed Since Installation?

sjvn
64-bits of protection?

jfruh
Android fragments vs. the iPhone monolith

mikelgan
What Gizmodo missed about the Pro WX Wireless USB disk drive

 

Sidekick: The Good News & the Bad News
Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325

Join the conversation here

The Daily Tip

The Daily TipQuick, practical advice for IT pros. Made fresh daily.

Hot tips:

Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.

Newsletters

Subscribe to ITWORLD TODAY and receive the latest IT news and analysis.

I would like to receive offers via email from ITworld partners.
By clicking submit you agree to the terms and conditions outlined in ITworld's privacy policy.
Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

Marketplace