Jump to content

Deleting multiple files, maybe using an input file?


Recommended Posts

Posted

Hope someone can help -- I need to delete about 50 unrelated files (with

no easily-matching patterns in their filenames) from a single directory.

I need to do this on the same directory on several different servers. I

have all 50 of these filenames to be deleted inside a text file. Is

there some way in XP to easily delete all 50 of these files, perhaps

using my text file as some sort of input file? Maybe a third-party

utility of some sort? Thanks.

  • Replies 2
  • Created
  • Last Reply

Popular Days

Guest HEMI-Powered
Posted

Re: Deleting multiple files, maybe using an input file?

 

Rick added these comments in the current discussion du jour ...

> Hope someone can help -- I need to delete about 50 unrelated

> files (with no easily-matching patterns in their filenames)

> from a single directory. I need to do this on the same

> directory on several different servers. I have all 50 of

> these filenames to be deleted inside a text file. Is there

> some way in XP to easily delete all 50 of these files, perhaps

> using my text file as some sort of input file? Maybe a

> third-party utility of some sort? Thanks.

>

if you know DOS you can turn your .txt files into a .bat file

("batch" file), with the string "del" without the quotes in front

of each extended file name (including drive letter and folder

names). A batch file is like a script, Windows DOS emulator will

execute each line as if you typed it individually in a Run box.

I've never actually tried this so at least part of my suggestion

may be bogus.

 

--

HP, aka Jerry

 

"Surely you jest - and don't call me Shirley!" - from the movie

"Airplane!"

Guest Pegasus \(MVP\)
Posted

Re: Deleting multiple files, maybe using an input file?

 

 

"Rick" <news-user@invalid.com> wrote in message

news:MPG.223f575adbf62b2e9899cd@msnews.microsoft.com...

> Hope someone can help -- I need to delete about 50 unrelated files (with

> no easily-matching patterns in their filenames) from a single directory.

> I need to do this on the same directory on several different servers. I

> have all 50 of these filenames to be deleted inside a text file. Is

> there some way in XP to easily delete all 50 of these files, perhaps

> using my text file as some sort of input file? Maybe a third-party

> utility of some sort? Thanks.

 

You can do this with a batch file like so:

@echo off

set FileList=c:\files.txt

set Target=d:\User Files

for /F "tokens=*" %%a in ('type "FileList"') do echo del "%Target%\%%a"

 

Remove the word "echo" in the last line to activate the batch

file. Set "Target" to the desired folder name, e.g.

\\SomeServer\d$\Accounting


×
×
  • Create New...