Topic "Scrip assistance please"

Author Message
Litestream

Guest


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?
Advertisements
Litestream

Guest


I get the text "host does not exist" on my command screen when I run the above
Litestream

Guest


Ok I've figured it out. Should be open sftp://user:password@xx.xx.xx.xx
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
For reference see here:
http://winscp.net/eng/docs/session_url
_________________
Martin Prikryl
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