Solved

Batch File to download all files from remote server using

Posted on 2010-11-28
3
756 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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Utilizing an array to gracefully append to a list of EmailAddresses
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…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now