...Follow up
In case anyone else comes across this post I thought I'd update it with how I dealt with the problem. Obviously the problem related to permissions but we don't have the expertise here to deal with that can of worms just now so I now create a script specific to the host prior to calling winSCP using a shell command e.g.
Shell("cmd.exe /k winSCP.com /script=" & ScriptFile......)
This seems to launch the cmd window with the same permissions as the calling app and everything works fine. Probably not the prettiest of solutions but it works.
Some things i noticed during my investigations:
1. Using the process technique I discovered that
winscp.StandardInput.WriteLine("open sftp://" & username & ":" & password & "@" & Host)
doesn't like passwords that have a "/" character in them. The password works fine when entered from command line prompt or from the GUI.
2. when using the "get" command it isn't very happy about spaces in the pathnames.
Anyway - thats all for now.
Shell("cmd.exe /k winSCP.com /script=" & ScriptFile......)
This seems to launch the cmd window with the same permissions as the calling app and everything works fine. Probably not the prettiest of solutions but it works.
Some things i noticed during my investigations:
1. Using the process technique I discovered that
winscp.StandardInput.WriteLine("open sftp://" & username & ":" & password & "@" & Host)
doesn't like passwords that have a "/" character in them. The password works fine when entered from command line prompt or from the GUI.
2. when using the "get" command it isn't very happy about spaces in the pathnames.
Anyway - thats all for now.