ftp append text to a file

  • Thread starter Thread starter VitaminB
  • Start date Start date
V

VitaminB

Hi Guys,

I want to write a batch file which gets a text file from an ftp server
and appends this to en existing text file. This works with the commands
ftp, open, get and then finally copy the new to the existing file.
BUT: I want to create a new file whenever no file (in the example:
C:\bla.txt) exists. How can I do this? Can I append/get directly with
an ftp command and if no file exists just create a new one?

open nsasasnnn.de
anonymous
get /cmm/bla.txt C:\bla_new.txt
quit
Call copy C:\bla.txt+C:\bla_new.txt C:\bla.txt /b
 
Hi,
Instead copy try to use:

type c:\bla_new.txt >> C:\bla.txt

Marcin Domaslawski
 

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

Back
Top