script to delete duplicate files

M

matt

Following a botched restore we have around 75,000 duplicate files on
one of our fileshares. All duplicate files start with the ~ character.
Is there any easy way to delete them all.

I thought maybe the following del /s ~*.* > d:\test\logfile.txt

However, this would delete any legitimate files starting ~ and I think
would also hit problems if users had the ~ versions of the files open
or had been updating the ~ version of the file.

Does anybody have any ideas?
 
T

Tim Hill

Are they in the same folders as the "good" files? In this case I would
suggest using a FOR to locate all NON "~" files in all folders. Then, for
each one, add a "~" to the front of the filename and, if it exists, delete
it (or move it to a dummy location for further manual inspection).

-Tim
 

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