PDA

View Full Version : Piloting securecrt from outside (vbs/vb6).


zorglups
09-20-2004, 02:24 AM
Isn't there any way to do something like this from a pure vbs script or within a VB6 application ? This would make easy piloting several sessions at once.

Set objCrt1 = CreateObject("SecureCRT.Application")
objCrt1.session.Connect("/telnet myhost1 2345")
Set objCrt2 = CreateObject("SecureCRT.Application")
objCrt2.session.Connect("/telnet myhost2 2345")
objCrt1.send "cd /usr/tmp"
objCrt2.send "cd /usr/tmp"

bocks
09-20-2004, 12:17 PM
Isn't there any way to do something like this from a pure vbs script or within a VB6 application ? This would make easy piloting several sessions at once.

In order to accomplish something like this, SecureCRT would need to have an external API that could be called. This is a feature that has been requested before. If you would like to have your contact information added to the request for this ability, please send me message at support@vandyke.com and I'll add you to the request.

The current version of SecurCRT does not have a programmable API, but it does allow you to execute a script when it is called by on the command line by using the /SCRIPT option:

securecrt.exe /script scriptname.vbs

Also, the scripting engine in SecureCRT was designed to run inside a single session. Because of this, only one connection at a time is supported.

Set objCrt1 = CreateObject("SecureCRT.Application")
objCrt1.session.Connect("/telnet myhost1 2345")
Set objCrt2 = CreateObject("SecureCRT.Application")
objCrt2.session.Connect("/telnet myhost2 2345")
objCrt1.send "cd /usr/tmp"
objCrt2.send "cd /usr/tmp"

This should cause an already connected error when run from inside the scripting engine in SecureCRT.

It may be possible to accomplish this by going about it in a different way.
Can you tell me a little more about what you are trying do?

-Shannon

zorglups
09-22-2004, 06:13 PM
Well, your answer is pretty clear... Not possible today.

I sent you my contact so you can warn me as soon as this is possible.

I won't bother you with this post as "what I would like to do" is described in the post "Controlling several sessions in parrallel."

Thanks for your reply to this thread anyway. This makes things clear.

Pierre.