Using a VBscript to execute a PASSPORT macro
PASSPORT PC to Host, PASSPORT Web to Host
TN3270, TN5250, VT, SCO ANSI, Wyse 60
I am trying to write a VBscript that will execute a PASSPORT macro. How can this be done?
The Session_NavigateTo function below can be used to execute a .ZAM macro:
Dim Sys, Sess Set Sys = CreateObject("PASSPORT.System") ' Assumes one or more open sessions: Set Sess = Sys.ActiveSession ' Assume there is MyLoginMacro.zam macro file: x = MsgBox ("Run login macro?", 1) If x = 1 Then Sess.NAvigateTo "MyLoginMacro" End If
Replace "MyLoginMacro" with the name of the macro that you are trying to execute. Make sure when you are running the macro from the command prompt, you enter the correct path where the VBScript file and macro are located. For example, if both the VBScript file and the macro are placed into the PASSPORT application folder (C:\Program Files\PASSPORT\ by default), then the command will look like this:
wscript C:\Program Files\PASSPORT\ExecuteMacro.vbs
Below is a sample VBScript that is used to execute a .ZMC PASSPORT macro. This script assumes a single, connected PASSPORT session. If more than one session is connected when the script is run, it will run the specified macro on the session that was connected first:
Set objShell = CreateObject("WScript.Shell") Set objExec = objShell.Exec("C:\Program Files\PASSPORT\PassMacr.exe /A 1234 0 login.zmc")
Replace "login.zmc" with the name of the macro that you are trying to execute. Make sure when you are running the macro from the command prompt, you enter the correct path where the VBScript file and macro are located. For example, if both the VBScript file and the macro are placed into the PASSPORT application folder (C:\Program Files\PASSPORT\ by default), then the command will look like this:
wscript C:\Program Files\PASSPORT\ExecuteMacro.vbs
The above samples should not be used from inside of a PASSPORT macro as only one macro may be running at a time. For more information, please see the following knowledge base article:
Running a macro within a macro in PASSPORT
vb, script, vbscript, execute, invoke, passmacr.exe, .exe, macro