Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Old 04-05-2017, 05:16 AM
Torrezno Torrezno is offline
Registered User
Join Date: Apr 2017
Posts: 3
Create a tab to connect and then use that tab in connection loop

Hi there,

I want to create a new tab with a connection:

Set tab = crt.Session.ConnectInTab("/FIREWALL /Telnet A.B.C.D0")

Then do stuff, and then disconnect that tab and reuse it for another connection in a looop:

tab.Session.Connect ("/FIREWALL /Telnet A.B.C.D1")
tab.Session.Connect ("/FIREWALL /Telnet A.B.C.DN")

This code is not working because it get stuck in the 2nd disconnect not showing the prompt till I stop the script and then show the prompt of the second telnet. (I'm currently using just 2 without a loop to build it incrementally.

I guess there is something wrong in the code but can't find where and googling didn't help.

Anyone knows what's the issue?

Reply With Quote
Old 04-05-2017, 08:48 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
Join Date: Jan 2017
Posts: 654
Hi Torrezno,

Will you be running the same commands on each host you connect to?

If so we have an example script that may accomplish what you are looking for.

I've included code below. In my testing using blocks like this seems to provide the functionality you are looking for.

  crt.session.ConnectInTab("/FIREWALL /Telnet A.B.C.D0")
  crt.Screen.Synchronous = True
   <Commands you want to run>

  crt.session.ConnectInTab("/FIREWALL /Telnet A.B.C.D1")
  crt.Screen.Synchronous = True
   <Commands you want to run>
Does this help?

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote

connect , disconnect , loop , reuse , tab

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 02:10 AM.