Deleting multiple files, maybe using an input file?

R

Rick

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.
 
H

HEMI-Powered

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.
 
P

Pegasus \(MVP\)

Rick said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top