We help IT Professionals succeed at work.

MS DOS BATCH FTP File Change Directory


I have some code (below) the code copies the first file but not the second file which is in another directory. I used cd.. to go back one directory the cd ilink_constituents which is whre the file I wish to copy is. The DOS screen say invalid command which I think is to do with cd..

Any help would be great thanks


@echo off
(echo open data.ftse.com
echo user username password
echo cd data
echo cd gilts
echo cd gilts_constituents 
echo mget *BGCO*.csv
echo cd..
echo cd ilink_constituents
echo mget *ILCO*.csv
echo quit
) | ftp -n -i

Open in new window

Watch Question

It should be

cd ..

(don't leave off the blank between cd and the dots).


great thanks!