Need a batch file set priority

  • Thread starter n o s p a m p l e a s e
  • Start date
N

n o s p a m p l e a s e

My OS is WInXP. I have an application. I want to set its priority to
below normal or low after I start this application.

I desire to do it through a batch file. How can I do it?

Thanx/NSP
 
B

Bob I

You would need to do it through scripting. A batch file can't do it
after the application has started.
 
J

ju.c

Use START.

Open the Run box and enter: cmd
In the Command Window type start /?


Your shortcut would be like this:
START "program.exe" /D"C:\Program Files\Program\" /BELOWNORMAL

------------------------------------------------------------------------------------------------
START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]

"title" Title to display in window title bar.
path Starting directory
B Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application
I The new environment will be the original environment passed
to the cmd.exe and not the current environment.
MIN Start window minimized
MAX Start window maximized
SEPARATE Start 16-bit Windows program in separate memory space
SHARED Start 16-bit Windows program in shared memory space
LOW Start application in the IDLE priority class
NORMAL Start application in the NORMAL priority class
HIGH Start application in the HIGH priority class
REALTIME Start application in the REALTIME priority class
ABOVENORMAL Start application in the ABOVENORMAL priority class
BELOWNORMAL Start application in the BELOWNORMAL priority class
WAIT Start application and wait for it to terminate
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to cmd.exe.
This means that the window will remain after the command
has been run.

If it is not an internal cmd command or batch file then
it is a program and will run as either a windowed application
or a console application.

parameters These are the parameters passed to the command/program
 
B

Bob I

That won't work AFTER the program is already running, as per the request.

ju.c said:
Use START.

Open the Run box and enter: cmd
In the Command Window type start /?


Your shortcut would be like this:
START "program.exe" /D"C:\Program Files\Program\" /BELOWNORMAL

------------------------------------------------------------------------------------------------

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]

"title" Title to display in window title bar.
path Starting directory
B Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application
I The new environment will be the original environment passed
to the cmd.exe and not the current environment.
MIN Start window minimized
MAX Start window maximized
SEPARATE Start 16-bit Windows program in separate memory space
SHARED Start 16-bit Windows program in shared memory space
LOW Start application in the IDLE priority class
NORMAL Start application in the NORMAL priority class
HIGH Start application in the HIGH priority class
REALTIME Start application in the REALTIME priority class
ABOVENORMAL Start application in the ABOVENORMAL priority class
BELOWNORMAL Start application in the BELOWNORMAL priority class
WAIT Start application and wait for it to terminate
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to cmd.exe.
This means that the window will remain after the command
has been run.

If it is not an internal cmd command or batch file then
it is a program and will run as either a windowed
application
or a console application.

parameters These are the parameters passed to the command/program
-------------------------------------------------------------------------------------------------------



ju.c


My OS is WInXP. I have an application. I want to set its priority to
below normal or low after I start this application.

I desire to do it through a batch file. How can I do it?

Thanx/NSP
 
A

Alec S.

n o s p a m p l e a s e wrote (in
My OS is WInXP. I have an application. I want to set its priority to
below normal or low after I start this application.

I desire to do it through a batch file. How can I do it?

Windows comes with apps to view and kill processes from the command line, but it
does not seem to come with one to change priority so you’ll need a copy of a
process manipulation app. The one I use is PV from Igor Nys because it is quite
powerful, but there other plenty of others like “Command Line Process
Viewer/Killer/Suspender” from BeyondLogic, etc.

Just put the app in your path, view the app’s docs to see how it changes
priority, and use that command.

For example, with PV, I would use:

pv -pi calc.exe

To set the Calculator to idle priority.


HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top