InvokeVBScript

Estimated reading: 3 minutes

The Invoke VBScript activity enables the execution of a standalone VBScript (.vbs) file within an automated workflow. It supports passing input arguments to the script at runtime and capturing the resulting output, making it well-suited for performing Windows-specific tasks through the Windows Script Host environment.

Properties

INPUT

VBScriptFilePath*: Specifies the full file path of the VBScript to be executed. Accepts a String value. The path may be hardcoded directly or supplied dynamically through a variable. The file must have a .vbs extension.

MISC

DisplayName: Defines the label displayed for the activity on the workflow canvas. This field may be customized to improve readability and simplify troubleshooting.

SkipOnError: Specifies a Boolean value (True or False):
True: Continues executing the workflow even if an error occurs.
False: Stops the workflow if an error is encountered.
None: If left blank, the default behavior is False.

Timeout: Defines the maximum duration, in milliseconds, the activity will wait before timing out. The default value is 30,000 ms (30 seconds).

Version: Displays the version of the activity being used. This field is auto populated and read-only.

OPTION

WaitForOutput: Determines whether the workflow should pause until the script completes and returns its output. Set to True to wait for completion before proceeding, or False to continue execution without waiting. Defaults to True.

OUTPUT

Result: Returns a Boolean value indicating the execution status. True confirms the activity completed successfully; False indicates a failure occurred.

ResultText: Returns the output produced by the VBScript as a String. If the activity fails, this field may be empty or may contain relevant error details.

*Represents the mandatory fields

Input Arguments Panel

To configure input arguments, click the Input Arguments button on the activity canvas. Each argument defined in this panel is passed into the script at runtime and referenced within the VBScript by its positional index.

Argument Table
Column Description
Direction Indicates the flow of data. Fixed as In and cannot be modified.
Type Indicates the data type of the argument. Fixed as String and cannot be modified.
Value The string value to be passed into the script at the corresponding index position.
+ Adds a new argument entry row.
× Removes the selected argument row.

How It Works

The activity accepts the file path of a VBScript and processes any input arguments provided. Upon execution, it returns the script’s output as a string value along with a status flag, which can be used to control downstream workflow behavior.

1. Drag and drop the Invoke VBScript activity into the workflow canvas and designate it as the start node.

2. Double-click the activity to open its properties panel.

3. In the VBScriptFilePath field, enter the full path to your .vbs file — for example, C:\Scripts\CheckNumber.vbs

4. Click Input Arguments to open the configuration panel. Enter the string values to be passed into the script. Each value is accessible within the script.

5. Connect a Write Log activity downstream to review the values returned in Result and ResultText.

Example – Number Evaluation Script

VBScript file path: C:\Scripts\CheckNumber.vbs

VBScript code:

num = CInt(WScript.Arguments(0))
If num > 5 Then
    result = “Number is greater than 5”
Else
    result = “Number is 5 or less”
End If
WScript.Echo result

The script reads the first input argument, evaluates it against the condition, and returns the appropriate result.

Input arguments passed: “10”, “3”, “2”, “8”

Output Reference:

Input Value ResultText Result
10 Number is greater than 5 True
8 Number is greater than 5 True
3 Number is 5 or less False
2 Number is 5 or less False

Write Log syntax – string output:

“Output is: ” + result

Write Log syntax – boolean expression:

“Result: ” + (num > 5).ToString

Share this Doc

InvokeVBScript

Or copy link

CONTENTS