Script: Custom Command Action

You can configure EFT to run executables, batch files, and scripts automatically when specific events occur. EFT calls these Commands. When the Event Rule is triggered, EFT executes the specified custom command and attributes.

To execute a Command from EFT’s Event Rule system

  1. Identify the Command you want to execute with the Event Rule or create a new custom Command using the procedure in Creating a Command. Or you can create a new Command later from within the Event Rule (in step 6 below).

  2. Open the Event Rule with which you want to execute the Command or create a new Event Rule using the procedure in Defining Event Rules.

  3. (Optional) If you need to apply any conditional behavior, click it in the Conditions list.

  4. In the Actions list, double-click Execute command in folder. The Action is added to the Event in the Rule Builder.

  5. Links in the Rule Builder indicate parameters that must be defined to save the Rule.

  6. In the Rule Builder, click one of the underlined text links. The Execute Command dialog box appears.

  7. In the Choose an existing or create a new Command list, click the list to select the command. (If you did not create the Command in step 1, click New to create the Command now.)

  8. The Executable path and Executable switches and/or parameters boxes display the path and switches for the selected Command. (If you want to change anything, you will have to close this dialog box, apply any changes to the Event Rule, go edit the Command, then reopen the Event Rule to continue defining it.)

  9. In the Working directory box, type the path or click the folder icon  to specify the folder in which the script or executable resides e.g., C:\EFTscripts. For mapped drives, use their UNC path. (File browse operations are disabled when you are connected remotely. You can't click the folder icon and browse, but you can type a path that is relevant to the EFT computer, not the remote interface).

  10. (Optional) In the Command parameters box, include any parameters for the command.

  11. You can select items in the Context variables list to add them as parameters. For example, suppose you want to run a script on a file that was uploaded and triggered the Event Rule. You would type the script name and the tag %FS.FILE_NAME%, as shown below:

    dosomethingwithfile.vbs -file %FS.FILE_NAME%

    Refer to Variables for details of available variables and how to use them.

    EFT passes the complete variable along to the Command; however, due to limitations of some command-line applications, they may not be able to interpret the Command properly. In certain instances, such as when there is a semicolon in a file name, you may need to enclose the variable in quotation marks in the Command Parameters box after you insert it from the Context variables box.

  12. (Optional) The Wait until this step completes before running the next step check box is selected by default. When the check box is selected, you can select the "If failed" action, and populate it with actions to run in case the rule fails. To allow the next step to run before this action completes, clear the check box. If check box is not selected, a prompt appears to confirm: "This step will be executed asynchronously (non-blocking), which means EFT won't wait for this step to be completed before running the next step. This could yield undesirable results if the next step depends on the output or outcome of this one. Are you sure you want to make this action asynchronous?" (All actions in the IF FAILED section are lost if the parent action is switched from async to sync mode.)

  13. Click OK to save the Command.

  14. Add other Actions as needed, and then click Apply to save the Event Rule.