Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FTP batch file

Posted on 2011-09-21
4
Medium Priority
?
360 Views
Last Modified: 2012-05-12
Hello all,  needing some help, trying to create a bat file to upload all .htm file in my directory C:/users/data to my /public_html directory on my website.  Would appreciate any help to get this done.
0
Comment
Question by:sandramac
4 Comments
 
LVL 5

Accepted Solution

by:
Alexey Komarov earned 2000 total points
ID: 36578759
Hi
FTP -v -i -s:ftpscript.txt


ftpscript.txt

open mysite.com
username
password
!:--- FTP commands below here ---
lcd C:/users/data
cd  public_html/
binary
mput "*.htm"
disconnect
bye
0
 
LVL 16

Expert Comment

by:AlexPace
ID: 36578973
What happens when you run it?  

It looks like you used forward slashes for you local folder.

Here is how you do it with Robo-FTP:
WORKINGDIR "c:\users\data"
FTPLOGON "ftp.mysite.com" /user="UserID" /pw="secret"
FTPCD "/public_html"
SENDFILE "*.htm"
FTPLOGOFF
EXIT

Open in new window

0
 
LVL 71

Expert Comment

by:Qlemo
ID: 36578975
I like using FTP without any extra command files, so the above would then look like:
@echo off
(echo open mysite.com
 echo username
 echo password
 echo !:--- FTP commands below here ---
 echo lcd C:/users/data 
 echo cd  public_html/
 echo binary
 echo mput "*.htm"
 echo disconnect
 echo bye
) | ftp -v -i

Open in new window

There methods for not needing to use echo, but they make the script more difficult to understand.
0
 
LVL 59

Expert Comment

by:Bill Prew
ID: 36580123
A great free utility that can do this is NCFTPPUT, take a look, it can do this all with a single line in a BAT file.

http://www.ncftp.com/ncftp/

~bp
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

971 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