We help IT Professionals succeed at work.

FTP batch file

captgriggs asked
Medium Priority
Last Modified: 2012-05-06
how do I write a batch file using the command line FTP built into Windows to download the readme file from ftp://ftp.leadtools.com/readme.txt
Watch Question


You'll need to create two files, one the batch file, and the other a text file with the list of commands to execute once you start the ftp program.

the batch file that actually calls the ftp program will look something like this (Items within <> are variables, and should be changed for your application, and the <> removed)-

@echo off
ftp -s:<TextFileWithCommands> <AddressOfFtpServer>

And the <TextFileWithCommands> file will look something like this
<ftp site username>
<ftp site password>

So for your example, your batch file will look like this -

@echo off
ftp -s:getreadme.txt ftp.leadtools.com

and the getreadme.txt file will look like this -

<ftp username>
<ftp password>
get readme.txt

Hope that makes sense.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.