Closes any Windows application by using the CloseMainWindow component in RPA Desktop Design Studio. This component accepts the Process ID as input.

Before you begin

Role required: none

About this task

You can configure the properties for the CloseMainWindow component. For more information about these properties, see Properties of the System Process components.

Procedure

  1. In the Toolbox pane, navigate to Utilities > System Process.
  2. Drag the CloseMainWindow component to the Design surface.
  3. To configure the input field, see Configure port properties.
  4. Connect the data and control ports of the CloseMainWindow to the corresponding ports of the other component as described in the following table.
    Parameter Description Port type Mandatory?
    ProcessId The process ID of the application to close. You can pass this value from a previously executed component. You can get the ProcessId by opening the Task Manager on your Windows machine.
    Example:
    ProcessId of Services.exe: 660
    Data In Yes
  5. (Optional) To test the component, under the DESIGN tab, click Run.

Example

As part of your automation workflow, after you have opened an app, such as Windows Terminal and ran a command on it, you can close the app window by providing the process ID in the CloseMainWindow component.CloseMainWindow component in a simple workflow showing ProcessId as parameter.