Home All Groups Group Topic Archive Search About

How to login in FTP (Client) from batch?

Author
12 May 2009 1:44 PM
niladri chatterjee
How to login in FTP (Client) from batch? This works interactively from CMD
but cannot login from batch.

My batch file is as follows:-

cd c:\file_copy
del /f  /q C:\file_copy\*.*
ftp -i
open 172.xx.0.yy
login-name
password
mGET *PACKSLIP.DOC;*
mGET *CONFIRMPRNT_CSVC.DOC;*
bye
copy /y  C:\file_copy\*PACKSLIP.DOC   R:\PDFS\PACKING_SLIP
copy /y  C:\file_copy\*CONFIRMPRNT_CSVC.DOC  R:\PDFS\R:\PDFS\CONFIRMPRNT_CSVC
del /f /q  C:\file_copy\*.*

Author
16 May 2009 4:22 PM
Gary
Take a look at the -s option. I have a batch file that runs M-F this way.
ftp -s:ftpfile.txt
ftpfile.txt
   open ip-addr
   username
   password
   other commands
   bye

Show quoteHide quote
"niladri chatterjee" <niladrichatter***@discussions.microsoft.com> wrote in
message news:3A6506D1-59E1-4700-B52C-AABACF33F121@microsoft.com...
> How to login in FTP (Client) from batch? This works interactively from CMD
> but cannot login from batch.
>
> My batch file is as follows:-
>
> cd c:\file_copy
> del /f  /q C:\file_copy\*.*
> ftp -i
> open 172.xx.0.yy
> login-name
> password
> mGET *PACKSLIP.DOC;*
> mGET *CONFIRMPRNT_CSVC.DOC;*
> bye
> copy /y  C:\file_copy\*PACKSLIP.DOC   R:\PDFS\PACKING_SLIP
> copy /y  C:\file_copy\*CONFIRMPRNT_CSVC.DOC
> R:\PDFS\R:\PDFS\CONFIRMPRNT_CSVC
> del /f /q  C:\file_copy\*.*