Processes - End
Declaration
<AMPROCESSES ACTIVITY="end" DOMAINNAME="text" REMOTEMACHINE="text" USERNAME="text" PASSWORD="text (encrypted)" PROCESSNAME="text" SAMEPROCESS="text (options)" PROCESSID="text" CLOSEMESSAGE="YES/NO" SAMEPROCESS="text (options)/>
Description
Forcibly ends the running instance of a process.
Practical usage
Used to force a process (usually a program or .EXE file) to shut down. Although using the Window - Close activity will gracefully close the application, at times this activity is preferable if the target process is frozen, not responding or unable to be shut down any other way (as is the case with certain applications that run in the task-bar).
Parameters
Process
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Find by name | Text | No | (Empty) |
|
If enabled, specifies the name of the process to terminate. This parameter supports the absolute (full) path or relative (file name only) path 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 exists, terminate | Text (options) | No | Oldest |
|
Indicates
which process instance should be terminated in case more than one
instance of a given process is running. The available options
are:
|
Find by process ID | Number | No | Yes | PROCESSID="11452" | If
enabled, specifies the process ID of the executable to terminate.
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. |
Send a "Close" message prior to terminating process | Yes/No | No | No | CLOSEMESSAGE="NO" | If
selected, an attempt to close the process gracefully will
be performed before terminating it forcibly. If disabled, the
application will be forcibly terminated immediately. NOTE: If this parameter is disabled, the process will not have opportunity
to clean up any system resources it was using before it ends. |
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. |
Example
- 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 ends the Notepad.exe process.
<AMPROCESSES ACTIVITY="end" PROCESSNAME="Notepad.exe" />
Example 2
This sample task ends all instances of the Internet Explorer process.
<AMPROCESSES ACTIVITY="end" PROCESSNAME="C:\Program Files (x86)\Internet Explorer\iexplore.exe" SAMEPROCESS="all" />