Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2012, 06:04 AM
hellfire hellfire is offline
Registered User
 
Join Date: Oct 2012
Posts: 15
open in Tab rather then in new window

Greetings,

Ive go a small question. Ive made an external script (non-CRT) that allows, based on input, to compile a proper vbs. script for CRT and the run it in RUN:<dir>/SecureCRT.exe /SCRIPT %somescript%.vbs

It all runs perfectly except for one small thing, every time it opens a new window. Regardless if i do use pre-configured session using /S or not, its new window. Is it possible to make CRT open new tabs, if one already exists.

Thanks
Reply With Quote
  #2  
Old 10-29-2012, 07:31 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi hellfire,

Thanks for the question. The command-line options available are documented in the Using the Software / Command-line Options chapter in the help file.

The specific command-line option you are seeking is "/T".

Does this help you accomplish your goal?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 10-29-2012, 07:40 AM
hellfire hellfire is offline
Registered User
 
Join Date: Oct 2012
Posts: 15
Thanks, i know that. When i launch CRT like this:
SecureCRT.exe /T /SCRIPT lalala.vbs it tells me i need and IP or Hostname to use /T. And i got them inside script.
Reply With Quote
  #4  
Old 10-29-2012, 11:04 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi hellfire,

Thanks for the update. If you are connecting in your script, then you should be using the "/T" protocol specific command-line option in the script as well.

Would you post the contents of lalala.vbs?

Can you help me understand why you are not using "/T" in the connection string in your script?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 10-29-2012, 11:01 PM
hellfire hellfire is offline
Registered User
 
Join Date: Oct 2012
Posts: 15
sure, here you go

Quote:
#$language = "VBScript"
#$interface = "1.0"
Sub main
crt.sleep 200
crt.Screen.Synchronous = True

Set corbina75870156= crt.session.ConnectInTab ("/SSH2 /L %login0% /PASSWORD %pass0% %ip0%")
corbina75870156.Caption= "%ip1%"
corbina75870156.Screen.Send "telnet %ip1%" & vbCr
corbina75870156.screen.WaitForString ":"
corbina75870156.Screen.Send "%login1" & vbCr
corbina75870156.screen.WaitForString ":"
corbina75870156.Screen.Send "%pass1%" & vbCr

corbina75870156.Caption= "%ip2%"
corbina75870156.Screen.Send "telnet %ip2%" & vbCr
corbina75870156.screen.WaitForString ":"
corbina75870156.Screen.Send "%login2%.a" & vbCr
corbina75870156.screen.WaitForString ":"
corbina75870156.Screen.Send "%pass2%" & vbCr

crt.sleep 200
crt.Screen.Synchronous = False
crt.sleep 200
End Sub
there are 2 "Caption" fields because, as I said earlier, script is generated on fly, there may be more than 2 telnet "steps" depending on actual topology =)

Last edited by hellfire; 10-29-2012 at 11:03 PM.
Reply With Quote
  #6  
Old 10-30-2012, 08:35 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi hellfire,

Thanks for posting the script. Since you are using the ConnectInTab method, you should not need to use "/T" on the command-line.

What version of SecureCRT are you using?

Can you tell me more about how you are launching your SecureCRT connections?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #7  
Old 10-30-2012, 10:21 AM
hellfire hellfire is offline
Registered User
 
Join Date: Oct 2012
Posts: 15
a ConnectInTab was just a try, but it failed for me.

Well, im using an external software to launch CRT when it is needed. Launching parameters: SecureCRT /S lalala.vbs

CRT version is 6.5.1

all I need is to prevent CRT from opening new windows and use tabs instead,
so, for example, if an external soft launches CRT three times it results in three tabs, not three windows. And i cant find how to make CRT act this way
Reply With Quote
  #8  
Old 10-30-2012, 02:54 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi hellfire,

Thanks for the data. I have created a feature request in our SecureCRT enhancement database to add the ability to use /Script alone on the command-line. Should we add this feature, we will let you know.

If you would like to be notified directly, please complete and submit the form at the following location:
Submit Feature Request
In the meantime, the best workaround that we have been able to find would be to move the connection out of the script. For example:
Code:
SecureCRT.exe /SCRIPT lalala.vbs /T /SSH2 /L %login0% /PASSWORD %pass0% %ip0%
Will this work for you?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #9  
Old 10-31-2012, 02:00 AM
hellfire hellfire is offline
Registered User
 
Join Date: Oct 2012
Posts: 15
Thanks for the reply, it will be very hard to implement due to external software structure, but..i guess its the onl way as I cant make CRT to act like this in _any_case.

Anyway, thanks, waiting for this feature to be implemented.
Reply With Quote
  #10  
Old 10-31-2012, 11:01 AM
gregg gregg is offline
Registered User
 
Join Date: Oct 2010
Posts: 53
Lightbulb

A hacky work-around could be to make the initial connection to a common place that every one running the script would have access to. (note: that server could even be /TELNET www.google.com 80) -- just anything that can create a connection and let the script run.

The script could then immediately do crt.session.disconnect and continue on with the crt.session.ConnectInTab part of the rest of your script.

I was thinking maybe trick it by connecting to 127.0.0.1, but the script doesn't execute until the connection is made.

Unfortunately, you can't call crt.GetActiveTab.Close on the initial tab because that's what the script is attached to.
Reply With Quote
  #11  
Old 10-31-2012, 11:20 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi gregg,

Thanks for posting the idea. We had the same idea and ran into the same problem using localhost and decided not to pursue any further.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730

Last edited by rtb; 10-31-2012 at 11:58 AM.
Reply With Quote
  #12  
Old 10-31-2012, 01:20 PM
hellfire hellfire is offline
Registered User
 
Join Date: Oct 2012
Posts: 15
Quote:
Originally Posted by gregg View Post
A hacky work-around could be to make the initial connection to a common place that every one running the script would have access to. (note: that server could even be /TELNET www.google.com 80) -- just anything that can create a connection and let the script run.

The script could then immediately do crt.session.disconnect and continue on with the crt.session.ConnectInTab part of the rest of your script.

I was thinking maybe trick it by connecting to 127.0.0.1, but the script doesn't execute until the connection is made.

Unfortunately, you can't call crt.GetActiveTab.Close on the initial tab because that's what the script is attached to.
Quote:
Originally Posted by rtb View Post
Hi gregg,

Thanks for posting the idea. We had the same idea and ran into the same problem using localhost and decided not to pursue any further.
Thanks guys, thats..more like it, I'll try this workaround
Reply With Quote
  #13  
Old 10-31-2012, 02:43 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi all,

I ran some additional tests, and found that using "/SERIAL" should work, and may be more innocuous than using "/TELNET hostname".
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #14  
Old 11-01-2012, 09:19 AM
hellfire hellfire is offline
Registered User
 
Join Date: Oct 2012
Posts: 15
sure, ill try that too, thanks
Reply With Quote
Reply

Tags
launch , tab


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 12:57 PM.