VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   How to execute another CRT VBS script from within one (https://forums.vandyke.com/showthread.php?t=10905)

dshaulis 02-26-2013 03:51 AM

How to execute another CRT VBS script from within one
 
Thanks for any help you can provide. I am looking to launch one of three scripts based on input from an IE Dialog box. If the user selects to run Procedure A, then a.vbs would be executed in the window. Same for Procedure B and C respectively.

The posts that i have seen on the forum talk about reading in the VBS script and using the "execute" or "executeglobal" methods which neither one seem to work for me. I know that if the VBS scripts are run via a button or from the Script->Run menu option, they complete without issues.

Also, each script (A, B or C) is very lengthy and has many Sub's and Functions in each one.

Any help would be greatly appreciated.
David

bgagnon 02-26-2013 10:21 AM

Hi David,

The Execute or ExecuteGlobal statements will be the only way you can accomplish your objective in SecureCRT.

Ideally you would just have one script and then each (script ABC) is in its own function, but it is understandable if you have to handle it this way due to each script (script ABC) having multiple subs and functions within.


Quote:

The posts that i have seen on the forum talk about reading in the VBS script and using the "execute" or "executeglobal" methods which neither one seem to work for me.
Could you provide additional information regarding the above statement?

In what way do these methods not work for you?

Did you get an error?

If so, what was it?

Does the "main script" (responsible for the IE dialog box) seem to "hang"?

If so, if you choose Cancel from the Script menu option, what is the error?

As a note, I have added this thread to a feature request in our product enhancement database to add the ability to run multiple scripts in succession. Should a future release of SecureCRT include this feature, notification will be posted here.

If you prefer direct e-mail notification, contact support@vandyke.com and include "Feature Request - Forum Thread #10905" in the subject line.

jlev 01-11-2019 02:26 PM

Quote:
I know that if the VBS scripts are run via a button or from the Script->Run menu option, they complete without issues.
If using the "Execute" or "ExecuteGlobal" commands, the scripts A, B, and C, should not be able to work independently within SecureCRT when using the "Run > Script" menu option. Scripts A, B, and C that are being called or executed cannot have the SecureCRT header at the top of the script.


All times are GMT -6. The time now is 09:38 PM.