Using FTP via COM returns Protocol.Sftp or Protocol.Scp
Hello!
I have a project where i shall transfer files to a FTP server. To this, I have tried to use WinSCP with the .NET assembly/COM library.
Using VBscript :oops:
I have tested with following downloaded installations:
I have registered
Where WinSCP is copied to
I use the example as provided here: https://winscp.net/eng/docs/library_com_wsh#vbscript, with the following modifications:
(Hostname, Username and Password is changed for my environment in my code)
However, on all my computers this fails with:
Any tips on what I do wrong?
I have a project where i shall transfer files to a FTP server. To this, I have tried to use WinSCP with the .NET assembly/COM library.
Using VBscript :oops:
I have tested with following downloaded installations:
winscp514automation.zip/winscp514setup.exe
(calling returns that winscp.dll
is incompatible, so tested older versions as well):
winscp513automation.zip/winscp513setup.exe
winscp510automation.zip/winscp510setup.exe
I have registered
Winscp.dll
using:
SET NETVersion=v4.0.30319 call "%WINDIR%\Microsoft.NET\Framework64\%NETVersion%\RegAsm.exe" "WinSCP.dll" /codebase /tlb
%ProgramFiles(x86)%\WinSCP
and above call is executed in this directory.
I use the example as provided here: https://winscp.net/eng/docs/library_com_wsh#vbscript, with the following modifications:
With sessionOptions .FtpMode = Passive .Protocol = Protocol_Ftp .HostName = "example.com" .UserName = "user" .Password = "mypassword" End With
However, on all my computers this fails with:
...and if I provideWinSCP: SessionOptions.Protocol is Protocol.Sftp or Protocol.Scp, but SessionOptions.HostKey is not set.
SessionOptions.HostKey
:
A SSH key should not be needed for FTP anyhow, so.....WinSCP: SSH host key fingerprint "ssh-rsa1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" does not match pattern .. blah blah.
Any tips on what I do wrong?