Programming with Reflection

image\rwnprg32.gif RunScript method


Syntax object.RunScript ScriptName, [ScriptArguments]



Runs a Reflection Basic script. For example:

Session.RunScript "C:\Mypath\Logon.rbs"


ScriptName Argument Type: String
Identifies the script to run. Reflection can locate a script without complete path information if the script is in a designated Script Folder, or is located in the Reflection macro path. Use the ScriptFolder property to designate a Script Folder. If you have a designated Script Folder, Reflection searches this folder for a script immediately after searching the current working folder, and before searching the User folder.

ScriptArguments Argument Type: String
This argument is for passing command line arguments to the script. The arguments are available within the script using the Command$ function


When you use RunScript to "chain" several scripts, you may receive a message saying that too many scripts are running. To avoid this, you can run scripts by calling the Main subroutine using a Declare statement. To call the Main subroutine in a script other than the current script, use the "Alias" option to rename the subroutine in the current script.


image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command