Scrip assistance please

Advertisement

Litestream
Guest

Scrip assistance please

I found this function on MSDN forums which is called from Excel:

Dim strQuote As String
strQuote = Chr(34)
Dim strSFTPDir As String
strSFTPDir = "c:\program files (x86)\winscp\"
Dim strCommand As String
strCommand = "/script=c:\test\abc\WinSCPGet.txt"
Call Shell(strSFTPDir & "winscp.com " & strQuote & strCommand & strQuote, vbNormalNoFocus)


The WINSCPGet.txt file contains the following:


# Connect to the host and login using password
open sftp://user:password.host.com
# Change the remote directory
cd /home/from/
# get all the files in the remote directory and download them to a specific local directory
get *.* c:\test\from\
# remove the files from the remote direcory
rm *.*
# Close and terminate the session
exit


I don't have a host name for my SFTP site, just an IP address so I changed the first line to open sftp://user:password.xx.xx.xx.xx but this does not seem to work

Any ideas how to fix this please?

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum