Solved

ftp files and folders nad subfolders

Posted on 2011-03-08
5
459 Views
Last Modified: 2012-05-11
Does anyone have a script or know how to login to an FTP site and download all files folders and subfolders?

thanks
0
Comment
Question by:SteveSext
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:Scovndrel
ID: 35079728
http://support.microsoft.com/kb/96269

FTP is capable of using scripts (lists of commands from external files). The following example demonstrates a script that opens a connection to IP address 11.11.11.11, logs on to the host as a guest with the password "guest," uploads the File1 file, and then quits:

open 11.11.11.11
user
guest
guest
put file1
quit

You must use the -s option for FTP to read this file under Windows. If the previous script was in a file called Test.scr, you can start the script by typing:

ftp -s:test.scr

You can specify the host name in the command line and then use the script to process the login. For example, if you use the following command line

ftp -s:test.scr 11.11.11.11

the script file should read as follows:
user
guest
guest
put file1
quit

However, if the FTP host implements automatic login, this command will not work. To turn off automatic login, use the -n switch in the command line as follows:
ftp -n -s:test.scr 11.11.11.11
0
 

Author Comment

by:SteveSext
ID: 35080546
thanks for that, if the site contains multiple files and folders, do you know how to download everything without being prompted for 'y' ?
0
 
LVL 4

Expert Comment

by:Scovndrel
ID: 35080578
I believe you use the "mget" command, for "get multiple files", and the next line on the script under the mget is a "y" all by itself, on that line, no quotes. The y by itself is the way to answer any prompts that you know will require it.
0
 

Author Comment

by:SteveSext
ID: 35081097
How can I download all subfolders as well? I think mget gets files only?
0
 
LVL 52

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 35082363
There is no native support for recursive file transfers in the basic FTP clients that are typically available.  With some scripting, or ZIPing up the files before the xfer you can move entire folder structures.

My preference is to use an FTP client though that adds this capability, like NCFTPGET.  It's free and a single command line can pull an entire folder tree.  There are other solutions that can do this as well.

http://www.ncftp.com/ncftp/doc/ncftpget.html

~bp
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 78
Server 2012 R2 missing roles and features 2 66
Apps blocked by Java 9 60
Filename to be appended with DateTimeof Download 3 44
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

912 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

21 Experts available now in Live!

Get 1:1 Help Now