Xshell Extra Files

Scrip to open multiple sessions

Last post: Thursday, March 17, 2016 8:15 PM by Support

Thursday, March 17, 2016 8:15 PM - Support

Scrip to open multiple sessions

 
Sub Main()
Dim objFile, File
Dim objClip
Dim username, password, filename

Set objFile = CreateObject("Scripting.FileSystemObject")
filename = xsh.Dialog.Prompt ("Filename with full path", "Filename", "", 0)
'Set File = objFile.OpenTextFile("d:\test.txt", 1)
Set File = objFile.OpenTextFile(filename, 1)

username = xsh.Dialog.Prompt ("Username", "User name", "", 0)
password = xsh.Dialog.Prompt ("Password", "Password", "", 1)


Do Until File.AtEndOfStream
hostname = File.Readline
'xsh.Screen.Send(hostname + vbCr)
xsh.Session.Open "ssh://"+username+":"+password+"@" + hostname + vbCr
xsh.Session.Sleep(50)
Loop

File.Close
End Sub