Processes - Set Priority
Declaration
<AMPROCESSES ACTIVITY="setpriority" DOMAINNAME="text" REMOTEMACHINE="text" USERNAME="text" PASSWORD="text (encrypted)" PROCESSNAME="text" 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 to set the priority to Realtime, the user must have proper security permissions to do so.
Process Parameters
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: The priority level to set the process to. The available options are:
|
Computer Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Local computer |
|
|
|
|
If enabled, specifies that the process to set resides on the local machine. This parameter is enabled by default. If this parameter is selected, the Another computer parameter becomes inactive. This is a visual mode parameter used during design time only, therefore, it contains no markups. |
Another computer |
|
|
|
|
If enabled, specifies that the process to set resides on a remote machine. The parameters below become active if this parameter is enabled. This is a visual mode parameter used during design time only, therefore, it contains no markups. |
Computer |
Text |
Yes |
(Empty) |
|
The host name or IP address of the remote machine where the process to set resides. 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 where the process to set resides. 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 in which the process to set resides. This parameter is available only if the Another computer parameter is enabled. |
Password |
Text |
Yes |
(Empty) |
PASSWORD="encrypted" |
The password corresponding to the username entered in the Username field. This parameter is available only if the Another computer parameter is enabled. |
Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.
Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)
On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)
Examples
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
Sample 1: Set priority of process "Photoshop.exe" on the local computer to "Above normal".
<AMPROCESSES ACTIVITY="setpriority" PROCESSNAME="Photoshop.exe" SAMEPROCESS="all" PRIORITY="abovenormal" />
Sample 2: Set priority of process "Photoshop.exe" on "remoteMachine.com/theRemoteMachine" to "High".
<AMPROCESSES ACTIVITY="setpriority" DOMAINNAME="remoteMachine.com" REMOTEMACHINE="theRemoteMachine" USERNAME="user" PASSWORD="AM2ooXWPmWe55c=aME" PROCESSNAME="Photoshop.exe" SAMEPROCESS="all" PRIORITY="high" />