Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Batch File to download all files from remote server using

Posted on 2010-11-28
3
Medium Priority
?
764 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
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…
Suggested Courses

688 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