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 07-24-2014, 03:02 PM
10tech 10tech is offline
Registered User
 
Join Date: Mar 2012
Posts: 20
VBScript Question

How do I add CRTL F4 (Close Session TAB) into a VBScript? The script looks like this:

Sub Main
crt.Screen.Send "****" & chr(13)
crt.Screen.WaitForString " # ", 2
crt.Screen.Send "LOGO" & chr(13)
crt.Screen.WaitForString " ! ", 2
crt.Screen.Send chr(4)
End Sub

Need to add Close Session TAB at the end of the script?

Help.

Thanks,
Tom.
Reply With Quote
  #2  
Old 07-24-2014, 03:26 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Tom,

It is not currently possible to close a tab that has a running script.

Can you tell me more about your goal?

What version of SecureCRT are you using?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 07-24-2014, 04:11 PM
10tech 10tech is offline
Registered User
 
Join Date: Mar 2012
Posts: 20
I'm using SecureCRT 7.0.4. I have a "Logoff" script built into a HotKey that allows me to logoff of a session within a TAB. The script works fine but does not close the TAB. I have to manually close the TAB each time. I would like to have the TAB close at the same time I am logging off of the Session. The VanDyke manual says I can do a "CTRL + F4" to close a TAB, which works ok, but I was thinking I could add the following to my script:

"crt.Session.Disconnect". Will this close the TAB?
Reply With Quote
  #4  
Old 07-24-2014, 04:55 PM
10tech 10tech is offline
Registered User
 
Join Date: Mar 2012
Posts: 20
The other issue I'm having is, ever since we went to WIN 7 from Win XP I have not been able to import .VBS files into MS Visual Basics. This is very frustrating as I do not know how to edit my SecureCRT .VBS files now. Anyone else have this issue?
Reply With Quote
  #5  
Old 07-25-2014, 09:23 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Tom,

Using the Disconnect() method of the Session object will only disconnect the session. If you were to enable Close on disconnect located in the Terminal category of the Session Options, you may get the behavior you want.

Does this help?

Quote:
The other issue I'm having is, ever since we went to WIN 7 from Win XP I have not been able to import .VBS files into MS Visual Basics. This is very frustrating as I do not know how to edit my SecureCRT .VBS files now. Anyone else have this issue?
I am not sure I understand the issue. Are you just having difficulty editing your scripts?

If so, you can edit them in Notepad by right-clicking on the script file and selecting Edit from the context menu.
__________________
--Todd

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 10:16 AM.