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)/>

Related Topics   

Overview

Forcibly ends the running instance of a process.

NOTE: Any data entered or any changes made in the program that has not been saved will be lost. Where possible, it is better to use the Window - Close activity because it notifies the application before actually shutting it down, thus giving the application time to clean up.

Practical usage

Used to force a process (usually a program or .EXE file) to shut down. Although using the Window - Close activity gracefully closes 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)
  • PROCESS="NOTEPAD.EXE"
  • PROCESS="C:\folder\process.exe"
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
  • SAMEPROCESS="oldest"
  • SAMEPROCESS="newest"
  • SAMEPROCESS="nothing"
  • SAMEPROCESS="all"
Indicates which process instance should be terminated in case more than one instance of a given process is running. The available options are:
  • Oldest (Default) - Only the oldest running instance of the process is terminated.
  • Newest - Only the newest (last) running instance of the process is terminated.
  • None - No instance of the process is terminated.
  • All - All instances of the process is terminated.
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 is performed before forcibly terminating it. If disabled, the application is immediately and forcibly terminated.
NOTE: If this parameter is disabled, the process cannot clean up any system resources it used 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)
  • REMOTEMACHINE="machine.domain.com"
  • REMOTEMACHINE="xxx.xxx.xxx.xxx"
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 into 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.

Description

Error Causes

On Error

Example

NOTE:
  • 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

The following sample task ends the Notepad.exe process:

Copy
<AMPROCESSES ACTIVITY="end" PROCESSNAME="Notepad.exe" />

Example 2

The following sample task ends all instances of the Microsoft Edge process:

Copy
<AMPROCESSES ACTIVITY="end" PROCESSNAME="C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" SAMEPROCESS="all" />