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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If you mean batch as in Windows batch, you can do that with the following script
tst.cmd:(replacing
myTargetMachine.comwith the name of your actual FTP server) and the following FTP command filetst.ftp:Obviously, you should replace the
myUserandmyPasswordwith your actual username and password, and alsodircommand with whatever you really want to do, such as:If you’re talking about a UNIX-like environment, the script would be:
Same deal with the FTP server name, user ID and password, of course.
And, in response to your comment:
You would use a script like the following
transfer.cmd:and
transfer.ftp:If you wanted the Windows version as a single file, you could use something like:
which temporarily creates
tst.ftpand then deletes it when it’s finished.