Processes - Set priority
Declaration
<AMPROCESSES ACTIVITY="setpriority" PROCESSNAME="text" SAMEPROCESS="text (options)" DOMAINNAME="text" REMOTEMACHINE="text" USERNAME="text" PASSWORD="text" PROCESSID="sdf" PRIORITY="text (options)" />
Description
Changes the execution priority of one or more instances of a process. If multiple instances of the process exist, priority can be set for the oldest, newest, all or no instances of the process. This activity supports local and remote processes.
Practical usage
Commonly used to adjust specific process priorities to improve performance or prevent badly behaved processes from negatively impacting the system's overall responsiveness. Note that in order to set the priority to Realtime, the user must have proper security permissions to do so.
Parameters
Process
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Find by name | Text |
No |
(Empty) |
|
If enabled, specifies the name of the process in which to set. This parameter supports entry of the absolute path (C:\folder\process.exe) or relative path (Notepad.exe) of the process. If this parameter is enabled, the Find by process ID parameter becomes inactive. This parameter is enabled by default. |
If multiple instances of the process exist, apply changes to | Text (options) | No | Oldest | SAMEPROCESS="nothing" | Indicates
which process instance should be set in case more than one instance
of a given process is running. The available options are:
|
Find by process ID | Text | No | Yes | PROCESSID="11452" | If
enabled, specifies the process ID of the process to set. If this
parameter is enabled, the Find
by name parameter becomes inactive. This parameter
is disabled by default. NOTE: Use the Processes
- Get Information activity to retrieve the process ID of a
given process. |
Change process priority to | Yes/No | No | No | PRIORITY="Idle" | The
priority level to set the process to. The available options are:
|
Computer
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Local computer | --- | --- | --- | --- | If
enabled, specifies that the process to end resides on the local
machine. This parameter is enabled by default. If this parameter
is selected, the Another Computer
parameter becomes inactive. NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes. |
Another computer | --- | --- | --- | --- | If
enabled, specifies that the process to end resides on a remote
machine. The parameters below become active if this parameter
is enabled. NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes. |
Computer | Text | Yes | (Empty) |
|
The hostname or IP address of the remote machine that contains the process to end. This parameter is available only if the Another computer parameter is enabled. |
Domain | Text | Yes | (Empty) | DOMAINNAME="netauto" | The domain name of the remote machine that contains the process to end. This parameter is available only if the Another computer parameter is enabled. |
Username | Text | Yes | (Empty) | USERNAME="Bruce.Wayne" | A valid username used to log onto the remote machine that contains the process to end. This parameter is available only if the Another computer parameter is enabled. |
Password | Text | Yes | (Empty) | PASSWORD="batman" | The password corresponding to the username entered in the Username field. This parameter is available only if the Another computer parameter is enabled. |
Examples
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Example 1
This sample task sets the priority of the process Photoshop.exe on the local computer to Above normal.
<AMPROCESSES ACTIVITY="setpriority" PROCESSNAME="Photoshop.exe" SAMEPROCESS="all" PRIORITY="abovenormal" />
Example 2
This sample task set priority of the process Photoshop.exe on a remote machine to High.
<AMPROCESSES ACTIVITY="setpriority" DOMAINNAME="remoteMachine.com" REMOTEMACHINE="theRemoteMachine" USERNAME="user" PASSWORD="AM2ooXWPmWe55c=aME" PROCESSNAME="Photoshop.exe" SAMEPROCESS="all" PRIORITY="high" />