Table of Contents

Command Line Parameters

The format is as follows, note the double quotes around the .BWSX file. The {space} below indicates there must be a single space between each of the items.

IDE

C:\Program Files (x86)\LGI_RPA\Lib\IDE.exe{space}{".bwsx"}{space}{projectID}{space}{main routine name}{space}{optional parameters}

Note: It is not recommended to run production automations from the IDE. The IDE will load a visible user interface and uses more memory than RPARuntime.

IDE does not support the ShowStatus optional parameter.

RPARuntime

"C:\Program Files (x86)\LGI_RPA\Lib\RPARuntime.exe"{space}{".bwsx"}{space}{projectID}{space}{main routine name}{space}{optional parameters}

The default behavior is for RPARuntime to load minimized to the systray.

The IDE Run tab has buttons to create a desktop shortcut or to copy command line parameters to the clipboard. Both features return for running RPARuntime.exe

"C:\Program Files (x86)\LGI_RPA\Lib\RPARuntime.exe"{space}{".bwsx"}{space}{projectID}{space}{main routine name}

In code, you can use c.Utilities.CreateAutomationCommandLine to create a correctly formatted string:

Dim cL As String
dim optionalParams As String
optionalParams = "Prod"
cL=C.Utilities.CreateAutomationCommandLine (C.Project.automationProjectID, C.Project.DatabaseFile, C.Project.MainRoutine,optionalParams)

Optional parameters must not contain any spaces, unless they are wrapped in double quotes. That string is available in VBA code using CommandLineParams.

Note if using the Start command in a .bat file have a space and two double quotes after the Start command:

Start ""{space}"C:\Program Files (x86)\LGI_RPA\Lib\RPARuntime.exe"{space}{".bwsx"}{space}{projectID}{space}{main routine name}

You must specific a MainRoutine if passing optional parameters since the command line arguments are split by space.

Note you can pass a file name with spaces by wrapping the file name in double quotes

The following commands are supported within Optional Parameters. Note these commands are case sensitive.

  • ShowStatus - RPARuntime loads visibly in the lower right corner of the screenLoad
  • CloseBWS - will close all BWS instances (and associated processes) that may be running. Do not do this if you expect to have more than one instance of LGI RPA running on that machine!
  • CloseDrivers - will close any WebDriver (Chrome or Edge) instances that may be running. Do not do this if you expect to have more than one instance of LGI RPA running on that machine!
  • CloseBrowsers- will close all browser instances Chrome or Edge that may be running. Do not do this if you expect to have more than one instance of LGI RPA running on that machine!

Use a delimiter (^ is a good choice) within optional parameters to pass multiple values and parse using strWord in VBA:

For example setting optional parameter to ShowStatus^Prod

In VBA would be parsed using.

Dim EMREnvironment as String

Sub Main_MyAutomation()
	EMREnvironment = strword(CommandLineParams, 2, ""^")

...

To pass file names as an optional parameter, wrap the file name in double quotes as shown below:

ShowStatus^CloseBWS^CloseDrivers^CloseBrowsers"c:\automations\data\account list.txt"

Dim readFile as string

Sub Main_MyAutomation()

readFile  = strword(CommandLineParams, 5, ""^")

readFile = replace(readfile,chr(34),"") ' this removes the quotes from the file name