Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-02-2009, 01:54 AM
sonix sonix is offline
Registered User
 
Join Date: Jan 2009
Posts: 5
Modify current session port forwarding

Hi

Is it possible to modify the current session port forwarding through a script?

I have wrote a script to connect to a list of server that i want to port forward, when I'm done I just realized that the current session port forwarding need to be set too.

The reason I need it because I need to have multiple session open to connect to a different server using a different port. I wrote a script because I don't want to save too many session in my secureCRT.

Thanks in advance
Reply With Quote
  #2  
Old 01-05-2009, 05:43 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi sonix,

The ability to change port forwards with a script is not currently possible.

When this ability is possible, we will post to this thread. If you would like to be notified directly, please send an email to support@vandyke.com with a subject of "Attn: Todd -- forum thread #3374."
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 01-20-2009, 07:04 PM
sonix sonix is offline
Registered User
 
Join Date: Jan 2009
Posts: 5
Hi Todd,

How about reading the current port forwarding settings?

Regards,
Sonix
Reply With Quote
  #4  
Old 01-21-2009, 02:57 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi sonix,

It is possible to read the current Port Forwarding settings with a script.

Please see the following example code snippet:

Code:
#$language = "VBScript"
#$interface = "1.0"

Sub Main

  Set objTab = crt.GetScriptTab
  Set objConfig = objTab.Session.Config

  szOption = "Port Forward Table V2"

  arr = objConfig.GetOption(szOption)

  sz = ""
  for each element in arr
      sz = sz & vbcrlf & element
  Next
  MsgBox "The array has " & ubound(arr) + 1 & " element(s)." & vbcrlf & vbcrlf & sz

End Sub
Does this help answer your question with regards to reading Port Forwarding settings?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 06-29-2009, 01:11 AM
sonix sonix is offline
Registered User
 
Join Date: Jan 2009
Posts: 5
Hi I got following error when trying the script

---------------------------
SecureCRT
---------------------------
Microsoft VBScript runtime error



Error: Object doesn't support this property or method: 'g_objTab.Session.Config'

File: E:\test.vbs

Line: 17
---------------------------
OK
---------------------------
Reply With Quote
  #6  
Old 06-29-2009, 11:44 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi sonix,

The error you have posted doesn't match the example script I posted.

Would you be able to post your modified script for me to analyze?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #7  
Old 06-29-2009, 02:42 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi sonix,

It is also possible that you are using a version of SecureCRT that doesn't support the Config method.

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

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #8  
Old 07-09-2009, 01:51 AM
sonix sonix is offline
Registered User
 
Join Date: Jan 2009
Posts: 5
If I just copy and paste your script, the error is seen below

---------------------------
SecureCRT
---------------------------
Microsoft VBScript runtime error



Error: Object doesn't support this property or method: 'objTab.Session.Config'

File: E:\VOD\SCRIPTS\test.vbs

Line: 8
---------------------------
OK
---------------------------


Btw my secureCRT version is 6.0.1 (build 213)
Reply With Quote
  #9  
Old 07-09-2009, 10:14 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi sonix,

Thanks for posting the error you are receiving and the version of SecureCRT you are using.

The ability to run the script that I posted wasn't added to SecureCRT until version 6.1.x.

You are welcome to download an evaluation version of SecureCRT 6.2.2 to see if this feature will work for you.

You can download SecureCRT 6.2.2 from the following location:
https://secure.vandyke.com/cgi-bin/a...?pid=SecureCRT
After installing SecureCRT 6.2.2, are you able to accomplish your scripting goal?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #10  
Old 07-29-2009, 12:07 AM
sonix sonix is offline
Registered User
 
Join Date: Jan 2009
Posts: 5
Thanks

Too bad the license purchased by my company only allow me to upgrade to 6.0.3

Seems like I have to live with it.

Thanks for looking into this
Reply With Quote
  #11  
Old 08-25-2010, 03:09 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
The ability to use "SetOption" to modify the Port Forward Table has been fixed in a later build of SecureCRT.
__________________
Thanks,
--Brenda

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

Last edited by rtb; 03-02-2015 at 07:55 AM. Reason: Outdated information was removed.
Reply With Quote
  #12  
Old 11-07-2013, 07:59 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi all,

This should be fixed as of SecureCRT 6.6.1 and newer. You can download the current official release of SecureCRT from the following location:
http://www.vandyke.com/download/securecrt/download.html
__________________
--Todd

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

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