Batch deletion based on .txt file on ftp

September 23, 2009 at 19:00:31
Specs: Windows XP
Hi.
I'd like to batch delete files in a selected directory(incl. subdirectories too) based on .txt on ftp.

In a local site, I can do it by making .bat like this:
--
set dir1=w:\docs\manual\
:
for /F %%i in ( delete-files.txt ) do del %dir1%\%%i
--

but i have no idea how to do it on ftp.

This ftp site is not accessible by drive/path.

ie. In delete-list.txt I have something like following:
--
somefile.pdf
someinvoice.xls
brahbrah.doc
brahbrah.txt
:
:
--

Any help will be greatly appreciated.

Thanks and regards.
Norik


See More: Batch deletion based on .txt file on ftp

Report •


#1
September 24, 2009 at 06:33:24
Untested, so test before using:
@(ECHO o server
ECHO user userName
ECHO userPassword
ECHO cd /someDir
FOR /F %%a IN (delete-files.txt) DO ECHO delete %%a
ECHO quit) > #
ftp -n -d -s:#
del #


Report •

#2
September 24, 2009 at 23:48:55
Razor2.3

Thank much!
It worked fine.

However, It didn't work for sub-dir though.

Anyway, it helped me save a lot of time.

Best,
Norik


Report •

Related Solutions


Ask Question