First time use of WinSCP, executecommand hanging
Also, I can't seem to get anything to work to see the remote console or what's going on the Red Hat screen when I send it commands. What code can I use to see console text for the executecommand action? Sorry, a lot of questions. Here's the code:
Dim SessionOptions As New SessionOptions
Dim Session As Session = New Session
With SessionOptions
' .SshPrivateKeyPath = "C:\Program Files(x86)\WinSCP\Private Key.ppk"
.AddRawSettings("SendBuf", "262144")
.AddRawSettings("SshProt", "3")
.AddRawSettings("Shell", "bash")
.GiveUpSecurityAndAcceptAnySshHostKey = True
.HostName = "GTCTCENT1"
.Password = Pwd
.PortNumber = 22
.Protocol = WinSCP.Protocol.Scp
.UserName = "stuff"
End With
With Session
.DisableVersionCheck = True
.SessionLogPath = "C:\Scheduler\Session.log"
.DebugLogPath = "C:\Scheduler\Debug.log"
.Open(SessionOptions)
.ExecuteCommand("su")
.ExecuteCommand("call ./update.sh")
System.Threading.Thread.Sleep(500) ' Wait half a second
.ExecuteCommand("close")
.ExecuteCommand("exit")
End With