What is the best way to remove 100,000 files from a Windows Directory

Solution 1:

You could use rmdir:

rmdir /s /q FOLDERNAME

Flags: /s means delete recursively, /q is the "quiet" mode.

Solution 2:

I use to have this problem with servers I was administering. Skip explorer altogether and use the command prompt. Navigate to the folder and "del ."

This way you avoid the overhead of the GUI (explorer is trash) and Recycling bin.


Solution 3:

Unless you need this for legacy 16-bit applications, try to increase the performance by disabling short file name generation. This can have a significant impact on directory operations with large number of files.

Regedt32 select:
"HKLM\system\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameC
reation"=1

Then use:

RMDIR /S /Q [drive:]path

to remove the directory with all its files.


Solution 4:

How about moving that temp folder to a different drive/partition? Instead of deleting all the garbage, you could format the drive (either GUI or command line). With quick format, this should be reasonably fast.


Solution 5:

This is a combination of the previous posts

open a command window:
File -> Run -> cmd

Remove the directory
rmdir /s /q FOLDERNAME

OR

Remove a pattern of files
cd \....\directory
del *.[something]

As you've noted in your question Windows Explorer can really slow things down.

After seeing your update, I have one of my own
Check out this List of file removers