

Original post (credit to for helping me understand the above stuff ^^): Special keys for the "SendKeys" function can be found using the virtual keyboard included in the iseries console software. With these 3 functions you can pretty much do anything you would do manually on an Iseries console. For better results, use the fuction "SearchText" in a while loop to wait for a specific text to appear on the interface if you want to be sure that the interface is ready for input. The function "WaitForInputReady" is badfully not very reliable.

$result = $oPS.SearchText("banana") search for the text "banana" on the interface screen. $oPS.SendKeys("hello world") write the text "hello world" where the cursor of the interface is then press the enter/return key $oPS.SetCursorPos(6, 53) put the cursor of the interface to position X = 6, Y = 53 $oOIA.WaitForInputReady() waits for the interface to be ready for input. Then there are 3 main functions that you can use to interact with the interface: Change it to another letter if you have multiples iseries console windows opened at the same time. The letter "A" is a reference to the name of the session displayed in the iseries console window, as explained before.
Ibm i access client solutions windows 10 code#
Use this code to create an autoIT object linked to the iseries console: Once you're logged into the Iseries console interface, the OS400 login window shows up: If you do not close it and open another one, the next one will be named "Session B". This is because it is the first Iseries window that is opened on the client computer. Notice that the name of the window (in the top left of the above screenshot) is "Session A". It looks like this:Īs it is a regular window, you can use the "AutoIT Window Info" tool and functions like "ControlSetText", "ControlClick" to automate the login process. AS400 are mainframes made by IBM and used mainly in professional workplaces.įirst you need to launch an IBM Iseries console to the AS400.
Ibm i access client solutions windows 10 how to#
Here are some informations on how to automate AS400 tasks with AutoIT. It counts every connected Legacy Client Access session, however leaves out any connected session created via Client Solutions. It already fails at the third line of the function. SetConnectionByName ( $lb_Selected ) If Not IsObj ( $po_objECLSession ) Then MsgBox ( 16, "Kritischer Fehler", "Konnte ECLSession-Objekt " & _ "nicht erstellen." & & "Programm wird beendet." ) Exit EndIf Return $ls_WindowName EndFunc WindowTitle $lia_Buttons = GUICtrlCreateButton ( $lsa_SessionWinTitle, 10, 10 + 35 * ( $i ), 280, 30 ) Next GUISetState ( ) While 1 $li_GUIMsg = GUIGetMsg ( ) Sleep ( 50 ) For $i = 0 To $gi_Sessions - 1 If $li_GUIMsg = $lia_Buttons Then $lb_Selected = $lsa_SessionName $ls_WindowName = $lsa_SessionWinTitle EndIf Next If $li_GUIMsg = $_gi_GUIClose Then Exit If $lb_Selected False Then ExitLoop WEnd GuiDelete ( ) $po_objECLSession = ObjCreate ( "tECLSession" ) $po_objECLSession. SetConnectionByName ( $lsa_SessionName ) $lsa_SessionWinTitle = $lsa_SessionWMConnections. Name $lsa_SessionWMConnections = ObjCreate ( "tECLWinMetrics" ) $lsa_SessionWMConnections.

Count Local $li_GUI = GUICreate ( "Select session (" & $gi_Sessions & ")", 300, 38 * $gi_Sessions ) Local $lia_Buttons Local $lb_Selected = False Local $ls_WindowName Local $li_GUIMsg Local $lsa_SessionWinTitle Local $lsa_SessionName Local $lsa_SessionWMConnections For $i = 0 To $gi_Sessions - 1 $lsa_SessionName = $go_ConList ( $i + 1 ). Refresh Local $gi_Sessions = $go_ConList. Expand collapse popup Global Const $_gi_GUIClose = - 3 Global $a _SelectConnectionEx ( $a ) Func _SelectConnectionEx ( ByRef $po_objECLSession ) Local $go_ConList = ObjCreate ( "tECLConnList" ) $go_ConList.
