|
#1
|
|||
|
|||
Using vbscript to clone session to new window...
Good Day: I recently started creating vbscripts to use with SecureCRT, and I must say I'm glad that capability exists!
I currently launch a script which opens a SecureCRT window, allows me to log into a session, and then creates three session clones. What I'd like to do is have that same script bring up a second SecureCRT window, allow me to log into a session, and then make clones of that. From what little bit I've tried today, I can create the second SecureCRT window from the script and log in, but the script goes back and executes commands in the first window instead of the second window. Does such capability exist? If not, is there a different way I could achieve this goal? My main focus is to have all the work be done by a single script. Thanks! |
#2
|
|||
|
|||
I'm not 100% sure I follow, but I do know the capability exists to clone a session (however many times you need to) and treat the clones differently as far as running commands, etc. I have not used vbscript in a decade or so, but I know the capability exists.
Mind sharing the code you are using? |
#3
|
|||
|
|||
Hi vstaral,
Sorry, presently there is not a way to accomplish your objective. I have added this thread to a feature request in our product enhancement database to add API(s) for controlling tabs across multiple main application windows. Should a future release of SecureCRT include this feature, notification will be posted here. If you prefer direct email notification, send an email to support@vandyke.com and include Feature Request - Forum Thread #14247 in the subject line or use this form from the support page of our website.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#4
|
|||
|
|||
Hi-
I can think of 2 possible work-arounds. 1. Create a second script that clones the current session 3 times when executed and in Session->Logon Actions->Logon Script set it to this new script. Theoretically, at connect time, the script will launch and do the cloning. You could get fancy by counting the number of open tabs and if it's 1, do the cloning; if not 1, don't clone. 2. In your current script, launch a new instance of securecrt which passes a /SCRIPT to start a cloning script (same idea as 1). Code:
#$language = "VBScript" #$interface = "1.0" Dim g_shell Set g_shell = CreateObject("WScript.Shell") scrt = "C:\path\to\VanDyke Software\SecureCRT\SecureCRT.exe" script = "C:\path\to\scripts\clonescript.vbs" command = chr(34) & scrt & chr(34) & " /SCRIPT " & chr(34) & script & chr(34) waitOnReturn = 0 windowStyle = 0 g_shell.Run command, windowStyle, waitOnReturn I would probably lean towards option 1 if that worked. |
#5
|
|||
|
|||
Hello Gregg, I like your ideas. Thanks! I plan to try them in the near future.
|
#6
|
|||
|
|||
I was looking at the workarounds and discovered I need to provide more detail regarding the functionality I'm seeking.
![]() I have a script that automates the ability to log into a router and connect to multiple async ports. The credentials, router address, and async port information are entered on a form generated by an IE Application Object (see attached). After the information is entered, the script will log into a terminal session, router, and the first async port. Next, it will create up to nine clones of that session and in each clone log into the router and an async port. That way the script can log me into ten async ports on one router. What I would like the script to do is, if I want to log into more than ten async ports (since that's the maximum number of sessions I can comfortably view in one SecureCRT window), have the script bring up a session in a new SecureCRT window, log into the router and async port, and then make as many clones as necessary. The trick that's eluding me is how to allow the script to take control of the new SecureCRT window and pass the information to those new sessions. It sounds like that functionality is not yet implemented in SecureCRT, but is there a workaround that could possibly accomplish these tasks? Thanks! Last edited by cboyack; 08-19-2020 at 07:42 AM. Reason: Made image viewable in-line. Please refer to https://forums.vandyke.com/showthread.php?t=14212 for instructions |
![]() |
Tags |
clone session , vbscript |
Thread Tools | |
Display Modes | Rate This Thread |
|
|