batch file - copy 1 file to FTP site

Posted on 2008-11-05
Last Modified: 2012-05-05

I need a .bat file to copy 1 file to an FTP server

the details are as follows

User: bob
Pass: bobPass
filename: mybackup.rar
LocalDir: C:\backups\
Remote: \htdocs\backups\

could someone please provide me with a script using the above details to do this

Question by:paulCardiff
    LVL 9

    Expert Comment

    you can use ftp script for this
    just use the command line options in a batch file
    LVL 6

    Accepted Solution

    Create the file script.txt and enter:
    cd /htdocs/backups
    put C:\backups\mybackup.rar

    and run with ftp -s:script.txt

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
    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…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 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

    18 Experts available now in Live!

    Get 1:1 Help Now