#1
|
|||
|
|||
Extracting query strings from telnet url
Hi!
First of all, I would like to say thank you for the great product. It is just awesome. So what I would like to achieve is that if we have such a url: telnet://192.168.1.1?title=Router tab title will change to "Router". I am trying to do this on my own like this: changing registry setting to include script and args extract query title from args change title using crt.window.caption = title So far I haven't succeeded, maybe there is better way to do this? Thank you. SecureCRT 7.3 for Windows |
#2
|
|||
|
|||
I finally managed to do that, but I am still looking for cleaner solution that does not involve passing url as argument.
In case someone needs here is value from registry: Code:
"C:\Program Files\VanDyke Software\Clients\SecureCRT.exe" /SCRIPT "C:\Program Files\VanDyke Software\Clients\Scripts\ChangeTitleToQuery.py" /ARG %1 /T %1 Code:
#$language = "Python" #$interface = "1.0" def main(): if crt.Arguments.Count > 0: first_arg = crt.Arguments[0] position = first_arg.find("title=") if position > 0: title = first_arg[position+6:] crt.Window.Caption = title main() |
#3
|
|||
|
|||
Hello Phen,
I am not really sure what you are trying to accomplish. Are you extracting the information to connect SecureCRT telnet sessions from within a script? Or via the command-line? Or do you just want to be able to use the existing URL to make connections using SecureCRT? If the latter option, you would need a wrapper script to handle the arguments (in addition to other configuration steps for making SecureCRT the default URL handler). We do have an example Telnet Handler wrapper script (VB Script) for ad hoc connections. I have attached it to my post.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#4
|
|||
|
|||
Quote:
They also provide modified putty and using that the title of putty window is Router. But you know, how ugly putty is. So I decided to make SecureCRT work with this. I managed to open links via registry modification, but window title showed only ip address and since ip address is the same for all devices but ports are different, SecureCRT showed tabs like this: Tab1 title: ip, Tab2 title: ip (1), Tab3 title: ip (2) I finally managed to change this behaviour using this registry change Code:
"C:\Program Files\VanDyke Software\Clients\SecureCRT.exe" /SCRIPT "C:\Program Files\VanDyke Software\Clients\Scripts\ChangeTitleToQuery.py" /ARG %1 /T %1 It works just fine but it seems that it is not the cleanest solution (I pass url two times: 1 for secureCRT execution and another one as an argument for script). Last edited by jdev; 12-05-2014 at 09:48 AM. Reason: Disable smilies |
#5
|
|||
|
|||
Hello Phen,
I know of no alternate method available presently. I have added this thread to a feature request in our product enhancement database for the ability to connect to hosts specified in URLs without using an argument (wrapper script). Should a future release of SecureCRT include this feature, notification will be posted here. If you prefer direct email notification, contact support@vandyke.com and include "Feature Request - Forum Thread #11811" in the subject line.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|