Hello, I'm trying to run WinSCP from a VBS script, but I have the following error when I open the session:
Connection has been unexpectedly closed. Server sent command exit status 1.
Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).
Note: the enum are not recognized, so I replace it the the corresponding value, found in the source code:
' Setup session options
Set sessionOptions = CreateObject("WinSCP.SessionOptions")
.Protocol = 1 'Protocol_Sftp
.HostName = "toto.com"
.UserName = "toto"
.Password = "abvc"
.SshHostKeyFingerprint = "sshxxxxxx"
Set session = CreateObject("WinSCP.Session")
' >> ERROR !
' Upload files
Set transferOptions = CreateObject("WinSCP.TransferOptions")
transferOptions.TransferMode = 0 'TransferMode_Binary
Set transferResult = session.PutFiles(vtFolderName & vFileName, "/data/", False, transferOptions)