ftp batch file

  • Thread starter Thread starter Val
  • Start date Start date
V

Val

Hello
Trying to create a batch file which will go out to the
vendor's ftp site grab some files on nightly basics and
download it back to our server.
Im stuck on the command that connects to their ftp site.
How can I make a connection with username and password as
a passed parameters so it will not get stuck at the prompt
for it?
if I use: ftp> open ft.vendorname.com in a batch file it
prompts me for user and password. In other words how can I
provide it in the same line as a connection?
Is it possible to do?
Any help is greatly appreciated.
Thanks.
 
Val said:
Hello
Trying to create a batch file which will go out to the
vendor's ftp site grab some files on nightly basics and
download it back to our server.
Im stuck on the command that connects to their ftp site.
How can I make a connection with username and password as
a passed parameters so it will not get stuck at the prompt
for it?
if I use: ftp> open ft.vendorname.com in a batch file it
prompts me for user and password. In other words how can I
provide it in the same line as a connection?
Is it possible to do?
Hi

FTP.EXE has a '-s' switch to use an answer file for scripting/batch
(run "ftp.exe -?" in a command prompt for more help):

Answer file:

--ftpit.txt--
<MyUserName>
<MyPassword>
binary
prompt
cd public/english/download
get myfile.ext
put yourfile.ext
bye
--end--


Then you can run it like this in the scheduler:

ftp.exe (as the executable)

-s:C:\ftpit.txt remote_server (as parameters)
 
Thank you that should work. One more question, how can I
only grab the files that were already updated since
yesterday. How can I compare the remote files to the ones
downloaded prior date?
Thanks in advance.
 
Back
Top