Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3854566
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:38:33+00:00 2026-05-19T17:38:33+00:00

I have a text file on one computer that I want to send to

  • 0

I have a text file on one computer that I want to send to a folder on a ftp site.
Can someone please show me a batch file code that will login to the FTP site with the username and password, and copy the text file.

Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:38:34+00:00Added an answer on May 19, 2026 at 5:38 pm

    If you mean batch as in Windows batch, you can do that with the following script tst.cmd:

    @ftp -n -stst.ftp myTargetMachine.com
    

    (replacing myTargetMachine.com with the name of your actual FTP server) and the following FTP command file tst.ftp:

    user myUser myPassword
    dir
    bye
    

    Obviously, you should replace the myUser and myPassword with your actual username and password, and also dir command with whatever you really want to do, such as:

    put localfile.txt /fullpath/remotefile.txt
    

    If you’re talking about a UNIX-like environment, the script would be:

    #!/bin/bash
    ftp -n myTargetMachine.com <<EOF
        user myUser myPassword
        dir
        bye
    EOF
    

    Same deal with the FTP server name, user ID and password, of course.


    And, in response to your comment:

    Yes, I am talking about from a Windows environment. So for arguments sake, let’s say the text file is C:\textfile.txt and I need to copy it to the FTP site in the folder called BACKUPS.

    You would use a script like the following transfer.cmd:

    @setlocal enableextensions enabledelayedexpansion
    @echo off
    c:
    cd \
    ftp -n -stransfer.ftp myTargetMachine.com
    endlocal
    

    and transfer.ftp:

    user myUser myPassword
    put textfile.txt /backups/textfile.txt
    bye
    

    If you wanted the Windows version as a single file, you could use something like:

    @echo off
    echo user myUser myPassword>tst.ftp
    echo dir>>tst.ftp
    echo bye>>tst.ftp
    ftp -n -s:tst.ftp myTargetMachine.com
    del /q tst.ftp
    

    which temporarily creates tst.ftp and then deletes it when it’s finished.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text file that contains a long list of entries (one on
Let's say you have a text file like this one: http://www.gutenberg.org/files/17921/17921-8.txt Does anyone has
I have text file with some stuff that i would like to put into
I have Text file that contains data separated with a comma , . How
I have a text file on my local machine that is generated by a
i have one text file: When i click the Download it should download and
I am new to Java. I have one text file with below content. `trace`
I have one text file as follows with 2 columns 44333373 -5.829738285 3007762 -5.468521083
I have a text file like the one below: this000is00a00test001251!! this000is00a00test001251!! this000is00a00test001251!! this000is00a00test001251!! I
I have a text file containing three columns of numbers; one column each for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.