The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
VBS Command Line
Jump to navigation
Jump to search
This example demonstrates how pass values to a VBS script with WScript.Arguments from the command line. You can use this, for example, to start a VBS file from batch files or the Windows task scheduler.
If WScript.Arguments.Count = 3 Then Macro1 = WScript.Arguments.Item(0) Macro2 = WScript.Arguments.Item(1) Macro3 = WScript.Arguments.Item(2) Else Wscript.Echo "Usage: MyScript.vbs Macro1 Macro2 Macro3" Wscript.Quit End If
Example: Start Internet Explorer from the command line and run the specified macro. We assume that the VBS file is named "start-ie.vbs".
VBS File:
If WScript.Arguments.Count = 1 Then Macro1 = WScript.Arguments.Item(0) Else Wscript.Echo "Usage: start-ie.vbs Macro1" Wscript.Quit End If set iim1= CreateObject ("imacros") 'Start Internet Explorer iret = iim1.iimInit ("-ie") 'Run the macro iret = iim1.iimPlay(macro1) 'Close IE again iret = iim1.iimExit(1) WScript.Quit(0)
Command Line:
start-ie.vbs mymacro