Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FTP batch file

Posted on 2011-09-21
4
Medium Priority
?
353 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 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 57

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

715 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