Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Slinnako

VB6 code for Winscp

Hi
I have tried the following code from VB6, first the one line command, inside the file sftptask.cmd:
C:\WinSCP\winscp.com /script=c:\ftpscr.ftp /log=c:\log\201010_newftp.log

And the script file ftpscr.ftp includes:
option batch abort
option confirm off
open sftp://nnnnnn:yyyyyyy@newftp.zzzzzz.com -hostkey="ssh-rsa 1024 abcdef1234567890"
option transfer binary
cd /pub/data_transfer
put c:\log\2010-10-25-881435.txt
get /pub/to_incap/*.txt c:\
close
exit

but this is not working from VB6 shell, like
retval = Shell(ftpcmd, vbNormalFocus)

It kicks me out in somewhere after login... BUT, when I run this same sftptask.cmd from the command prompt, it WORKS successfully! Pls., anyidea why it does not work from VB6?

Thanks
Seppo
martin

Re: VB6 scripting example

I do not have any experience with VB, so I cannot. Maybe some other user may help.
mrusu

VB6 scripting example

Hello,

Is it possible to include a "Full VB6 Example" together with existing "Full VB.NET Example" and "Full C# Example" in the scripting documentation?
I am having problems converting the VB.NET scripting code into classic VB (Visual Basic 6).

The reason I need VB6 code is that I would like to run WinSCP scripts from an MS Access database (that can only be coded using VB6).

Any help will be greatly appreciated.

Kind regards,
M. Rusu