Is there a way to delete a folder in
Windows and not having the time taken
proportional to the number of files
within it?
I don't think so, but some methods are clearly much quicker than others.
The worst way is to send to Recycle Bin: you still need to delete them. Next worst is shift+delete with Windows Explorer: it wastes loads of time checking the contents before starting deleting anything.
Next best is to use rmdir /s/q foldername
from the command line. del /f/s/q foldername
is good too, but it leaves behind the directory structure.
The best I've found is a two line batch file with a first pass to delete files and outputs to nul to avoid the overhead of writing to screen for every singe file. A second pass then cleans up the remaining directory structure:
del /f/s/q foldername > nul
rmdir /s/q foldername
This is nearly three times faster than a single rmdir, based on time tests with a Windows XP encrypted disk, deleting ~30GB/1,000,000 files/15,000 folders: rmdir
takes ~2.5 hours, del+rmdir
takes ~53 minutes. More info here.
This is a regular task for me, so I usually move the stuff I need to delete to C:\stufftodelete and have those del+rmdir
commands in a deletestuff.bat batch file. This is scheduled to run at night, but sometimes I need to run it during the day so the quicker the better.
In terms of file system, deleting to Recycle Bin is more or less like moving. The files you delete are put into a special protected Windows directory, and potentially the whole data needs to be read and written in a other place.
On the other hand, deleting with Shift+Del
, the file is simply erased from the file system. This is mush faster, as it's not about changing the whole file, but only removing the few bytes telling that a file is there.
Plus, concerning Total Commander, as explain here : http://www.ghisler.ch/board/viewtopic.php?t=14480:
This happens when your recycle bin is very full. TC deletes one file after the other in normal mode, which takes a while when the bin is quite full.
Try to delete with Shift+Del (bypassing the bin), or using the Explorer method.
Unfortunately this behaviour cannot be changed, because Windows doesn't report which files were deleted and which not when deleting them all in one operation...
Best Answer
Win95Delete=1
According to This post anyway...