ftp batch file

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.
 
T

Torgeir Bakken \(MVP\)

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)
 
V

Val

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top