|
#1
|
|||
|
|||
run function in all active sessions
I created a script to send multiple commands in all active sessions, but these commands are in another function, so when I run this script all the commands are send to one session.
Code:
Sub Main crt.Session.ConnectInTab("/S session1") Function1 crt.Session.ConnectInTab("/S session2") Function1 For nIndex = 1 to crt.GetTabCount Set objCurrentTab = crt.GetTab(nIndex) objCurrentTab.Activate if objCurrentTab.Session.Connected = True Then Function1 end if Next End Sub Sub Function1 crt.Screen.Send "command 1" & vbcr crt.Screen.Send "command 2" & vbcr End Sub Last edited by jdev; 09-18-2018 at 11:44 AM. Reason: wrap code in [code] blocks to preserve indentation |
#2
|
||||
|
||||
Quote:
If you desire to send commands to all of your sessions from within a script, you should take one of these approaches:
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
#3
|
|||
|
|||
Thank you Jake, now the script is running in all sessions
![]() |
![]() |
Tags |
function , multiple , session |
Thread Tools | |
Display Modes | Rate This Thread |
|
|