Computing.Net > Forums > Programming > Batch deletion based on .txt file on ftp

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch deletion based on .txt file on ftp

Reply to Message Icon

Name: nooorik
Date: September 23, 2009 at 19:00:31 Pacific
OS: Windows XP
Subcategory: Batch
Tags: .bat, ftp, coding, script
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: September 24, 2009 at 06:33:24 Pacific
Reply:

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 #


1

Response Number 2
Name: nooorik
Date: September 24, 2009 at 23:48:55 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Batch deletion based on .txt file on ftp

Read a txt file in Vb www.computing.net/answers/programming/read-a-txt-file-in-vb/7871.html

Webpage content to TXT file www.computing.net/answers/programming/webpage-content-to-txt-file/14510.html

delete line from txt file if a colum is like! www.computing.net/answers/programming/delete-line-from-txt-file-if-a-colum-is-like/19419.html