Converting Scripting to VB Script
Hi!
I apologize for the length of my post - just wanted to include all relevant information.
I have been using WinScp for about 4 years to perform a simple GET & PUT using the script method ie passing a batch file written in notepad to WinScp.exe - this works fine.
The accounting package I support uses VB script and I want to automate WinScp in real time so, I created a VB alternative but I cannot get past an error that says "Further Authentication Required". I compared the logs for the scripted version versus the VB version and they are identical in structure except for my mentioned error.
The error log says:
! 2015-04-14 11:55:50.832 Using username "username"
. 2015-04-14 11:55:50.879 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2015-04-14 11:55:50.879 Using stored password.
. 2015-04-14 11:55:50.879 Sent password
! 2015-04-14 11:55:50.941 Further authentication required
. 2015-04-14 11:55:50.941 Further authentication required
. 2015-04-14 11:55:50.941 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2015-04-14 11:55:50.941 Disconnected: Unable to authenticate
Here is my original script - that works fine.
###Get All Waiting Orders
option batch abort
option confirm off
open sftp://username:password -hostkey="ssh-rsa 2048 0000"
cd /OUT
option transfer ascii
get -delete *.xml d:\accredosaturn\scripts\bunn\inbox\
close
exit
This is my VB script - not working:
Dim SessionOptions as Object, Session As Object
Session=CreateObject("WinSCP.Session")
SessionOptions=CreateObject("WinSCP.SessionOptions")
Protocol=SessionOptions.Protocol
Protocol="Sftp"
SessionOptions.SshHostKeyFingerprint="ssh-rsa 2048 7d:33:b8:7b:cb:74:b6:92:85:8e:fa:f1:7e:fc:a7:df"
SessionOptions.HostName="ftp.site.com"
SessionOptions.UserName="username"
SessionOptions.Password="password"
Session.SessionLogPath="D:\Temp\Winscp.txt"
Session.Open(SessionOptions)
Session.Dispose
Any help would be HUGELY appreciated!
Kind Regards
Shayne Harris, New Zealand
I apologize for the length of my post - just wanted to include all relevant information.
I have been using WinScp for about 4 years to perform a simple GET & PUT using the script method ie passing a batch file written in notepad to WinScp.exe - this works fine.
The accounting package I support uses VB script and I want to automate WinScp in real time so, I created a VB alternative but I cannot get past an error that says "Further Authentication Required". I compared the logs for the scripted version versus the VB version and they are identical in structure except for my mentioned error.
The error log says:
! 2015-04-14 11:55:50.832 Using username "username"
. 2015-04-14 11:55:50.879 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2015-04-14 11:55:50.879 Using stored password.
. 2015-04-14 11:55:50.879 Sent password
! 2015-04-14 11:55:50.941 Further authentication required
. 2015-04-14 11:55:50.941 Further authentication required
. 2015-04-14 11:55:50.941 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2015-04-14 11:55:50.941 Disconnected: Unable to authenticate
Here is my original script - that works fine.
###Get All Waiting Orders
option batch abort
option confirm off
open sftp://username:password -hostkey="ssh-rsa 2048 0000"
cd /OUT
option transfer ascii
get -delete *.xml d:\accredosaturn\scripts\bunn\inbox\
close
exit
This is my VB script - not working:
Dim SessionOptions as Object, Session As Object
Session=CreateObject("WinSCP.Session")
SessionOptions=CreateObject("WinSCP.SessionOptions")
Protocol=SessionOptions.Protocol
Protocol="Sftp"
SessionOptions.SshHostKeyFingerprint="ssh-rsa 2048 7d:33:b8:7b:cb:74:b6:92:85:8e:fa:f1:7e:fc:a7:df"
SessionOptions.HostName="ftp.site.com"
SessionOptions.UserName="username"
SessionOptions.Password="password"
Session.SessionLogPath="D:\Temp\Winscp.txt"
Session.Open(SessionOptions)
Session.Dispose
Any help would be HUGELY appreciated!
Kind Regards
Shayne Harris, New Zealand