/
How do I target other sessions from a script?
How do I target other sessions from a script?
PROBLEM DESCRIPTION or QUESTION
Can I open a new session using “xsh.Session.Open” within a script and then have the rest of the script run in the newly opened session?
RESOLUTION
Xshell scripts include a function to select another session. However, this function is only available when Xshell is in single process mode.
In [Tools] - [Options] - [Advanced], check the [Use single-process mode for better performance] option and run Xshell again.
In the script, use the xsh.Session.SelectTabName("session name") function after xsh.Session.Open and then run the script.
xsh.Session.Open("C:\\Users\\test\\Documents\\NetSarang Computer\\7\\Xshell\\Sessions\\test.xsh"); -> In this case, the session name will be test. xsh.Screen.Synchronous = true; xsh.Session.Sleep(1000); xsh.Session.SelectTabName("test") xsh.Screen.Send("help")
Related content
Why does my connection to an Amazon Linux 2023 instance fail when using an RSA key?
Why does my connection to an Amazon Linux 2023 instance fail when using an RSA key?
Read with this
Multisession [3]
Multisession [3]
More like this
Why does the program run slowly when changing directories to a folder with a large number of files?
Why does the program run slowly when changing directories to a folder with a large number of files?
Read with this
script api problem [1]
script api problem [1]
More like this
Public Key User Authentication.
Public Key User Authentication.
Read with this
Which session will be send [1]
Which session will be send [1]
More like this