Solved

Batch File to download all files from remote server using

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
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…

739 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