Changing Windows process priority on the fly via command line.

Message boards : Number crunching : Changing Windows process priority on the fly via command line.
Message board moderation

To post messages, you must log in.

AuthorMessage
Profile HAL9000
Volunteer tester
Avatar

Send message
Joined: 11 Sep 99
Posts: 6534
Credit: 196,805,888
RAC: 57
United States
Message 1283633 - Posted: 14 Sep 2012, 15:26:09 UTC

It has been asked several times if there is a way in Windows to adjust process priority on the fly automatically. Generally you can install software such as process lasso or such.

However there is a command line option to so the same thing using wmic. Apparently it has been around since XP... I recently learned about it when doing some other things. So I figured I would share the info.

The command line syntax:
wmic process where name="AppName" CALL setpriority ProcessIDLevel

The customary notepad example setting it to "Above Normal":
wmic process where name="notepad.exe" CALL setpriority 32768

Idle:		64
Below Normal:	16384 
Normal:		32 
Above Normal:	32768
High Priority:	128
Real Time:	256


On XP/2003 I had to run wmic by itself first where it stated "Please wait while WMIC is installed.

At the moment I'm trying to work out how to use the Task Scheduler to set the science app priority up when the machine is idle and then return them to low when not idle.
SETI@home classic workunits: 93,865 CPU time: 863,447 hours
Join the [url=http://tinyurl.com/8y46zvu]BP6/VP6 User Group[
ID: 1283633 · Report as offensive
.clair.

Send message
Joined: 4 Nov 04
Posts: 1300
Credit: 55,390,408
RAC: 69
United Kingdom
Message 1283730 - Posted: 14 Sep 2012, 19:46:38 UTC

Ah.
The hidden feature`s of an operating system . . .
If only we knew what they were,
where they iz
And wot to do with them once we have found them :¬)
For better or worse ....
ID: 1283730 · Report as offensive
Cruncher-American Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor

Send message
Joined: 25 Mar 02
Posts: 1513
Credit: 370,893,186
RAC: 340
United States
Message 1283738 - Posted: 14 Sep 2012, 20:09:30 UTC - in response to Message 1283730.  

Yeah - almost as well documented as my phone apps. God, bad programmers ought to have their own personal place in Hell.
ID: 1283738 · Report as offensive
outlaw

Send message
Joined: 6 Mar 00
Posts: 43
Credit: 17,063,897
RAC: 0
Canada
Message 1286355 - Posted: 21 Sep 2012, 17:37:05 UTC

You can use Task Manager, it is probably quicker and less error prone; and they both call the same API.

Go to the Processes tab, right click the process you wish to change the priority of...
ID: 1286355 · Report as offensive
EdwardPF
Volunteer tester

Send message
Joined: 26 Jul 99
Posts: 389
Credit: 236,772,605
RAC: 374
United States
Message 1286518 - Posted: 22 Sep 2012, 3:38:56 UTC - in response to Message 1283633.  

I love this kind of stuff!!!!

Thanks for the post!!!

Ed F
ID: 1286518 · Report as offensive
kittyman Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 9 Jul 00
Posts: 51468
Credit: 1,018,363,574
RAC: 1,004
United States
Message 1286548 - Posted: 22 Sep 2012, 6:46:23 UTC
Last modified: 22 Sep 2012, 6:46:41 UTC

Our friend Fred's priority tool does a wonderful job of setting the priority of Seti apps to whatever level you wish. And does so automatically every time a task is finished and a new task launches.
"Freedom is just Chaos, with better lighting." Alan Dean Foster

ID: 1286548 · Report as offensive
Profile HAL9000
Volunteer tester
Avatar

Send message
Joined: 11 Sep 99
Posts: 6534
Credit: 196,805,888
RAC: 57
United States
Message 1287391 - Posted: 24 Sep 2012, 14:16:01 UTC - in response to Message 1286355.  

You can use Task Manager, it is probably quicker and less error prone; and they both call the same API.

Go to the Processes tab, right click the process you wish to change the priority of...

This information is more for those that ask how to change the to process priority automatically. Other than telling them to "install 3rd party software".

Since I stumbled on it while doing other things & no one had mentioned it before, that I could find, I figured someone might have a use for it.

A full write up about all the various ways of controlling the science app processes would probably be more informative when I get around to putting this up on my webserver.

SETI@home classic workunits: 93,865 CPU time: 863,447 hours
Join the [url=http://tinyurl.com/8y46zvu]BP6/VP6 User Group[
ID: 1287391 · Report as offensive

Message boards : Number crunching : Changing Windows process priority on the fly via command line.


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.