FTP batch file

Posted on 2009-02-09
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
Question by:captgriggs
    1 Comment
    LVL 1

    Accepted Solution


    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

    and the getreadme.txt file will look like this -

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

    Hope that makes sense.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    This article will show, step by step, how to integrate R code into a R Sweave document
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    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…

    759 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

    8 Experts available now in Live!

    Get 1:1 Help Now