Error : Error skipping startup message. Your shell is probably incompatible with the application

Advertisement

OlivierC
Joined:
Posts:
1
Location:
France

Error : Error skipping startup message. Your shell is probably incompatible with the application

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
Dim sessionOptions
Set sessionOptions = CreateObject("WinSCP.SessionOptions")
With sessionOptions
    .Protocol = 1 'Protocol_Sftp
    .HostName = "toto.com"
    .UserName = "toto"
    .Password = "abvc"
    .SshHostKeyFingerprint = "sshxxxxxx"
End With
 
Dim session
Set session = CreateObject("WinSCP.Session")
 
' Connect
session.Open sessionOptions
' >> ERROR !    
' Upload files
Dim transferOptions
Set transferOptions = CreateObject("WinSCP.TransferOptions")
transferOptions.TransferMode = 0 'TransferMode_Binary
 
Dim transferResult
Set transferResult = session.PutFiles(vtFolderName & vFileName, "/data/", False, transferOptions)

Reply with quote

Advertisement

Guest

Ok thanks, I'll retry

In fact I'm not using Windows Script File, so I don't know how to specify the <reference object="WinSCP.Session" />
My VB script is directly launch from a SCADA system. I have to ask the hotline.

But, for the moment I succeeded in running a command line:
Dim WshShell
Set WshShell = CreateObject("WScript.Shell") 
Dim cmd
cmd = """C:\Program Files (x86)\WinSCP\WinSCP.com"" /command ""open sftp://xxxxxxx/ -hostkey=""""ssh-ed25519 255 xxxxxxxxx="""""" ""lcd " & vtFolderName & " "" ""cd /data"" ""put " & vFileName & " "" ""exit"" "
' "0" pour que la fenêtre ne s'ouvre pas.
' "TRUE" pour attendre avant de passer à la ligne suivante.
Dim retv
retv = WshShell.Run(cmd, 0, True)

Reply with quote

Advertisement

You can post new topics in this forum