6.1. Setting the Priority of a Process
You want to raise or lower the priority of a process. This is beneficial if you want to boost a CPU-starved process or limit a process that is hogging the CPU.
Using a graphical user interface
Open Windows Task Manager (taskmgr.exe).
Click on the Processes tab.
If you do not see the process you want to set, be sure the box beside Show processes from all users is checked.
Right-click on the target process, select Set Priority, and select the desired priority.
You can also accomplish the same task using the Sysinternals Process Explorer (procexp.exe) tool: right-click on the process and select Set Priority.
Using a command-line interface
With the start command, you can set the priority of a process when you initially run it. The following example shows how to create a process with a high priority:
> start /HIGH
The other valid priority options include
' This code sets the priority of a process Const NORMAL = 32 Const IDLE = 64 Const HIGH_PRIORITY = 128 Const REALTIME = 256 Const BELOW_NORMAL = 16384 Const ABOVE_NORMAL = 32768 ' ------ SCRIPT CONFIGURATION ------ strComputer = "." intPID = 3280 ' set this to the PID of the target process intPriority = ABOVE_NORMAL ' Set this to one of the constants above ' ------ END CONFIGURATION --------- WScript.Echo "Process PID: " & intPID set objWMIProcess = GetObject("winmgmts:\\" & strComputer & _ "\root\cimv2:Win32_Process.Handle='" ...