Solved

FTP batch file

Posted on 2011-09-21
4
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Accepted Solution

by:
Alexey Komarov 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 70

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 54

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Rename files on Windows 10 54
Need help on taking backup in postgress SQL -- Challenging question 4 68
Wild card search and replace using Notepad 7 69
Upgrade dos 4.00.1111 11 67
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…
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…

734 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