Page 1 of 1

help with batch file for FTP transfer

Posted: 10 Nov 2008 11:00
by talytech
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

Posted: 10 Nov 2008 21:40
by DosItHelp
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:

Posted: 12 Nov 2008 08:31
by talytech
Thank you so much. That worked!