Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP File Pickup

Status
Not open for further replies.

evalesthy

Programmer
Oct 27, 2000
513
0
0
US
I have used:

'blnSuccess = FTPDownloadFile("YourHostName", "YourUserName", "YourPassword", "YourLocalFileName", "YourRemoteFileName", "YourDir", "YourMode")

to pickup files from ftp sites. Now however, I need to set both Port and Security (Auth TLS) as well.

I can pick up the file manually using FireFTP but will need a script to run it eventually. Anyone have any experience with this?

Thanks.
 
You can use VBScript to dynamically write a ftp script:

Code:
Dim fso
Set fso = WScript.CreateObject("Scripting.Filesystemobject")

Set ftp = fso.CreateTextFile("c:\temp\ftpscript.txt",True)
ftp.WriteLine "open ftp.myftpserver.com 21"
ftp.WriteLine "myusername"
ftp.WriteLine "mypassword"
ftp.WriteLine "Binary"
ftp.WriteLine "cd myfolder"
ftp.WriteLine "lcd c:\mylocalfolder"
ftp.WriteLine "get myremotefile.zip"
ftp.WriteLine "put mylocalfile.zip"
ftp.WriteLine "bye"
ftp.Close

Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "cmd.exe /C ftp -s:c:\temp\ftpscript.txt >c:\temp\ftpscript.log 2>&1",1,True

Looking for a good VBScript editor? Try Vbsedit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top