Topic "Scripts with VBA....."

Author Message
little_android
[View user's profile]

Joined: 2015-04-03
Posts: 3
I would like to make a script using EXCEL VBA to transfer a file called "spisak.xls" to the remote server. The file is located in: "E:\obrdan\mapweb\". For that purpose I'm typing the following script in VBA Excel:
path(0) = "C:\program files\winscp\"
fi = FreeFile
Open path(0) + "ftp.txt" For Output As #fi
Print #fi, "open ftp://username:password@ftp.server.com" ' your login and password"
Print #fi, "lcd E:\ObrDan\mapweb" 'change local dir
Print #fi, "put -transfer=bynary spisak.xls"
Close

Shell "winscp.com /script=ftp.txt /ini=nul"


And nothing happens. So the first question is from where (which directory) does winscp reads the ftp.txt file, or respectively in which directory should I place the file ftp.txt? And the next question is what should I change in the code in order to transfer the file? Thank you in advance.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
If you do not specify a path to the script file, WinSCP reads it from the current (startup) working directory.

Also note that it's binary, not bynary.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License