Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-01-2020, 08:02 AM
kimhieu kimhieu is offline
Registered User
 
Join Date: Jan 2020
Posts: 2
Run script, but only run on one window with many tabs

I have a script ( test.vbs)

Sub Main()

crt.Screen.Synchronous = True
crt.Session.Connect "/TELNET 10.51.53.31"
crt.Screen.WaitForString "name:", 1
crt.Screen.Send "redacted" & vbCr
crt.Screen.WaitForString "password:", 1
crt.Screen.Send "redacted" & vbCr
...
...

End Sub

In VB6, I run SecureCRT by this command
Shell PathSecure + " /SCRIPT D:\test.vbs"

The problem is each times run command, will have one window appear to run script to telnet. Run 10 times , they will have 10 secureCRT windows.

I want that each times run command, my script will run on other tabs in same one window ( not open a another secureCRT window)

Please help me in this case.

Thank you

Last edited by bgagnon; 01-01-2020 at 10:41 AM.
Reply With Quote
  #2  
Old 01-01-2020, 10:45 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,154
Hi kimhieu,

I am not sure launching it in the external manner that you are, that they can use the same window, but the option to open in a tab is /T. What are the results if you add /T to your connect command?

crt.Session.Connect "/T /TELNET 10.51.53.31"

And in that case, you might also need to use /N for tab name (/T /N "MyNewTab" ).
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 01-01-2020, 06:35 PM
kimhieu kimhieu is offline
Registered User
 
Join Date: Jan 2020
Posts: 2
Quote:
Originally Posted by bgagnon View Post
Hi kimhieu,

I am not sure launching it in the external manner that you are, that they can use the same window, but the option to open in a tab is /T. What are the results if you add /T to your connect command?

crt.Session.Connect "/T /TELNET 10.51.53.31"

And in that case, you might also need to use /N for tab name (/T /N "MyNewTab" ).
Dear bgagnon

Thank you for your help.

I try to use your way.
crt.Session.Connect "/T /TELNET 10.51.50.50"

but it still run window each times run script.

If I run telnet directly from CMD, then OK

"C:\Program Files\VanDyke Software\Clients\SecureCRT.exe" /T /Telnet 10.51.5.84


While i need run some command in my script
Reply With Quote
  #4  
Old 01-02-2020, 11:58 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,154
Hi kimhieu,

So you might be able to get it working if you make the change indicated in the FAQ titled "How can I make SecureCRT the default SSH2 application for Windows so that I can launch it from a web browser?". (But in your case for telnet, not ssh.)
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 05:17 PM.