Solved

FTP batch file

Posted on 2011-09-21
4
308 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 4

Accepted Solution

by:
alexeykomarov earned 500 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 68

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 51

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

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…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

14 Experts available now in Live!

Get 1:1 Help Now