set sessionOptions = WScript.CreateObject("WinSCP.SessionOptions")
.Protocol = 1 ' SCP
.HostName = "192.168.X.X"
.UserName = "myusername"
.Password = "mypassword"
.SshHostKey = "ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
set session = WScript.CreateObject("WinSCP.Session")
session.ExecuteCommand("wl -i eth1 radio on")
VBScript does not offer try/catch so the existing error-handling examples for C#, VB.NET and JScript cannot be used for VBScript. I would appreciate it if you could provide an example of how to test for errors generated by the Session object when used in VBScript. For example, an error may arise after using its Open or ExecuteCommand methods.
I suspect SessionRemoteException is used but I'm not sure how.