VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Reloading the session list (https://forums.vandyke.com/showthread.php?t=12530)

ogun 11-08-2016 07:03 AM

Reloading the session list
 
Hello.

We've written a script that we've used for some years now that fetches a session list from an external host and then creates sessions from there.
The scripts first deletes a folder "Shared" in the session directory on the client and then creates new sessions from the list by cloning the default session and saving.

We then run the script as a login script when connecting to our jump host.
The issue is that after the sessions are created, new session do not show up until you restarts SecureCRT. Is there any API call that I can use to tell scrt to reload the session database?

jdev 11-08-2016 10:48 AM

There isn't a direct API for refreshing the session manager's contents.

You can refresh it manually by closing and re-opening your Session Manager (not just auto-hiding it).

Perhaps this snippet of code might work, but I think it would require a script tab that is connected to a remote host.
Code:

crt.Screen.SendSpecial("MENU_TOGGLE_SESSION_MANAGER")
crt.Sleep(500)
crt.Screen.SendSpecial("MENU_TOGGLE_SESSION_MANAGER")
crt.Sleep(100)

--Jake

ogun 11-11-2016 10:11 AM

Many thanks, that did the trick.

I will try and post my code on github later to share with everybody.

Maureen 12-05-2016 12:05 PM

The scripting API has been modified so that the Session Manager is automatically refreshed when a new session is added through a script. This support is available in SecureCRT 8.1, which is in beta testing. If you'd like to try it, please send email to me at Maureen.Jett@vandyke.com.

Maureen


All times are GMT -6. The time now is 03:30 AM.