Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Batch File to download all files from remote server using

Posted on 2010-11-28
3
Medium Priority
?
765 Views
Last Modified: 2012-05-10
I need a batch file that I can call to download all files from a remote server using ftp. I need to supply a username and password...download all files to the directory: C:\Data.  Can anyone assist?
0
Comment
Question by:OB1Canobie
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 34226830
Are all these files in one directory?  If so you can use MGET with the standard FTP client otherwise it will get very messy.

@echo off
(echo open 110.110.110.110
echo user username password
echo lcd c:\destdir
echo cd /source/path
echo bin
echo mget *.*
echo quit
) | ftp -n -i

where all files from /source/path on the server 110.110.110.110 will be brought to C:\destdir

Scripting with ftp.exe you can do in a number of ways.  The above is my favoured when the script is static but I have some more examples here:

http://scripts.dragon-it.co.uk/links/batch-ftp-scripting?OpenDocument

Steve
0
 

Author Closing Comment

by:OB1Canobie
ID: 34227092
Excellent!
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 34228491
No problem, glad it helped.

Steve
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question