script to delete duplicate files

  • Thread starter Thread starter matt
  • Start date Start date
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?
 
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
 
Back
Top