- Create your event script. Below is a sample script template that is capable of returning a success or failure to the results file (event script will not run successful without a result returned):
'Add your script here
'Uncomment the required line below to return a success or failure:
'SetResult false, "An error happened and this is my custom message"
Sub SetResult(bolSuccess, strMessage)
Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objResultsFile: Set objResultsFile = objFSO.OpenTextFile(WScript.Arguments.Item(0), 2, True)
If bolsuccess = true then
If strMessage <> "" Then objResultsFile.WriteLine strMessage
- Add your VBScript as a Data event within composer (when browsing for the file you will need to select All Files)
- Create another event script where you would like the script to be executed
- Type in or browse to the path of either wscript.exe or cscript.exe in the System32 folder (SysWOW64 folder if you need a 32 bit scripting engine on a 64 bit platform)
In the Parameters field, type the name of your VBScript followed by the $scriptresult$ parameter (contains results-file path) and any additional parameters your script requires. Example is given below (take note of the quotation marks):
- Ensure that you do not select the Bundle Script Executable with Package option as this will include the scripting engine with your package
- Set all other options as required
Important note: If your event script is set to run using the system account by not selecting Run with User Privileges (non-system account), then any dialogs that your script produces will be hidden and the event will appear to 'hang'.