help with batch file for FTP transfer

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
talytech

help with batch file for FTP transfer

#1 Post by talytech » 10 Nov 2008 11:00

I am trying to auto connect to FTP site and transfer a file to my local hard drive. The following code is what I have but isn't working:

Code: Select all

@echo off 
cd c:\documents and settings\e3utbl\desktop\ert
ftp
open fm-nsnotrix
username
password
get span\span.txt
bye


Could someone please help me with this? What happens when I run this script the DOS window opens to the "FTP>" prompt

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

#2 Post by DosItHelp » 10 Nov 2008 21:40

talytech,

Try:

Code: Select all

@ftp -i -s:"%~f0"&GOTO:EOF
open fm-nsnotrix
username
password
!:--- FTP commands below here ---
lcd "c:\documents and settings\e3utbl\desktop\ert"
text
get span\span.txt
disconnect
bye

More info on how it works here:
http://www.dostips.com/DtTipsFtpBatchSc ... h_FtpBatch

DosItHelp? :wink:

talytech

#3 Post by talytech » 12 Nov 2008 08:31

Thank you so much. That worked!

Post Reply