Start applications on specific CPU, priority

* There are actually three ways to do this. First, you could find the process using task manager, right click, and manually adjust the priority or affinity of the process. This is temporary, however, and will not be the same after reboot. To make it permanent, there are two methods. This first way to run with a set priority or affinity, permanently, is to use CMD as an administrator. Let's look at paint, for example. Simply run:

start /affinity 2 /abovenormal mspaint.exe

You can customize the command above and replace the "2" with the processor number that you want the processor to run on. You can also adjust the priority level by using a different flag than "/abovenormal", such as:

/Low
/Normal
/High
/Realtime
/Abovenormal
/Belownormal

* Those flags should be relatively self-explanatory. Now for the fun part: deciding what needs what. As a rule of thumb, main processes such as explorer.exe should be given a flag of high. SVCHOST processes should not be tampered with, unless you know what you are doing. The affinity of an application, which is to say what processor it is running on, is usually by default running on all processors. You would need to monitor task manager to determine the number of active threads running under a normal load, and prioritize those which tend to consume the most system resources. You could also load a script or use the start utility to create a user defined application base priority, or to apply a set of parameters to every instance of an app, say CMD prompt. Using command prompt as an example, you could run this CMD:

cscript modify_bp.vbs cmd.exe HIGH

That would make every instance and thread of cmd.exe run in a high priority, but the script needs to exist first. For using the start command line utility, type start/help for a list of acceptable parameters to create your script, which in this case is "modify_bp.vbs". The parameters you could use include:

* Title: Title to display in window title bar.

* Path: Starting directory

* B: Start application without creating a new window. The application will have ^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 a program in separate memory space

* SHARED: Start a program in shared memory space

* LOW: Start the application in the IDLE base priority class

* NORMAL: Start the application in the NORMAL base priority class

* HIGH: Start the application in the HIGH base priority class

* REALTIME: Start the application in the REALTIME base priority class

* ABOVENORMAL: Start the application in the ABOVENORMAL base priority class

* BELOWNORMAL: Start the application in the BELOWNORMAL base priority class

* WAIT: Start the 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 which will run as either a windowed application or a console application.

Needless to say, this method requires some basic scripting knowledge. It is too lengthy to explain, so just use either the CMD or task manager method if you are unsure. Here is an example of a properly written script:

Code:
MODIFY_BP.VBS
Const REAL_TIME = 128
Const HIGH = 256
Const ABOVE_NORMAL = 32768
Const NORMAL = 32
Const BELOW_NORMAL = 16384
Const LOW = 64
logo
set objArgs = wscript.arguments
If objargs.count < strprocess =" objArgs(0)" strbasepriority =" UCase(objArgs(1))" strcomputer = "." objwmi =" GetObject(" colprocess =" objWMI.ExecQuery" name =" '" i =" i">

* An easier way is to use Sysinternals, which is a Microsoft program. Using sysinternals is easy. Once you have the program downloaded and extracted, run PROCEXP.EXE (the Process Explorer executable). Now, from the View menu, select Columns. Click on the "Process Performance" tab and check "Base priority". Locate the “calc.exe” process (it will be a child process of the explorer.exe process). The base priority column will show a numeric value for the process’s running base priority; right-click on the process and select "Set Base priority".

Sysinternals Screenshot:

Image

* Notice that once the base priority has been selected, the change is made immediately. This can be seen during the Process Explorer change; the calc.exe application base priority changes from 8 (Normal) to 10 (Above Normal). While this change is immediate, it is temporary. You can also use Sysinternals for a variety of tasks, including to manage startup configuration. Neither Task Manager nor Process Explorer allows the user to save the new base priority for the application; when the application exits and restarted, the base priority is reset to its default value. You will therefore need to use either the scripting or command line prompts to make it permanent. For more technical users, you can get more information on setting priorities and affinities here. For less technical users, temporarily changing settings using Task manager is your best bet; if you mess something up, or something quits working, simply restart your computer. Technically, you can use your registry to make changes as well. This method is difficult to explain, and the paths/values vary based on the application.