Need to write batch script which copies file from FTP to local drive
I’m trying to achieve this using cmd command prompt
inside batch file
please help me or paste any thread.
I found the answer thanks a lot but,
I need to use 2files script.txt and batch.bat
which contains script.txt code:
open ftp.server.com
username
password
cd folderpath/newfolder
get file1.xml
close
bye
and batch.bat code
ftp -v -i -s:script.txt
echo done!
But How can i do it using only
.batfile so that I need only 1 file not 2 files
As a starting point:
The next step would be to make steps 1-4 automatic by scripting the commands and using file/string manipulation to update the hosts file if necessary.
With a drive mapped you can then presumably do a normal Xcopy from one drive to another.
Reference:
http://answers.yahoo.com/question/index?qid=20080612073002AAruBR0
UPDATE In response to your edit:
In your main batch.bat file, dynamically create script.txt as follows:
Then do
Finally – to tidy-up, remove the temporary script.txt: