39

I have deleted about half a million files from a folder, and didn't think to press Shift in order to delete them completely straight away.

Now they're clogging my recycle bin, and Windows claims it will take 4 hours to empty it - it claims to do about 68 files per second.

Is there some magic or an alternative method that can speed this up?

Bounty - I'm starting a bounty. The files are still in my bin, as there was no pressing need to get rid of them and this way, I can try out the suggestions presented. I am, however, looking for a way that does not include hard-deleting the contents of the RECYCLER folder - I'm sure that would work, but it feels a bit unclean to me.

Pekka
  • 2,459

7 Answers7

39

Do you have a virus scanner that does on-access scanning? Disable it during your delete action.

With my virus scanner disabled deleting is over 10 times faster.

(I never understood why it checks files that are about to be deleted)

Jeff
  • 649
25

There's RecycleNOW, a small utility that empties the Recycle Bin immediately, no matter how much it contains. (Or at least I've seen it run very quickly even with my Recycle Bin containing ~1 GB of data.) Works with Windows 7.

Once you get it, just double-click on the executable file, and it's done. The Recycle Bin should be empty.

Isxek
  • 3,965
17

It shouldn't be that slow, unless you have shell extensions installed that hook the delete process to do something (like the NTFS Link Shell Extension's "Smart Delete" feature).

But you can always try

RmDir /S "C:\$Recycle.Bin"

and

RmDir /S "C:\RECYCLER"

and they might be faster. They'll delete your entire recycle bin on C:, though (including other users' files).

user541686
  • 23,629
10

A hardcore method is to unhide hidden and protected OS files in Folder Options, then shift +delete the Recycler (XP) or $Recycle.Bin (Vista, 7) folder on the root of C:

If it will not let you, use a Linux distro boot CD and delete them from there.

Moab
  • 58,769
8

I have noticed that Windows 7 handles the Recycle Bin much worse than XP did, particularly when there are a lot of items in it. Whenever I have a bin filled with a ridiculous number of files, and especially when in 7, what I do is to open a command-prompt (cmd), and use a simple command to delete the Recycle Bin at the file-system level (change the drive as necessary):

rd /s /q C:\$RECYCLE.BIN > nul

There can be a few different names for the Recycle Bin directory depending on the version of Windows and other installed programs (e.g., $RECYCLE.BIN, RECYCLED, RECYCLER, RECOVERY BIN). For compatibility with different versions of Windows as well as the old Norton Protected Recycle Bin, use this version (it presumes that there are no legitimate files or folders in the drive’s root that happen contain recycl; which is rare anyway):

rd /s /q C:\*recycl* > nul

What this does is to delete the folder and all of its contents, and redirect any output to nul (ie, don’t show any output whatsoever).

This is probably the fastest method of flushing the Recycle Bin for a few reasons:

  • Booting a live-CD will of course take a while to shutdown Windows, boot the other OS, then shut that down, and re-boot Windows, which altogether defeats the purpose
  • Emptying or even deleting the Recycle Bin in Explorer (even with Shift+Del) causes extra house-keeping to take place which does not occur with the rd command
  • Redirecting the output to nul speeds things up (technically, it should not be displaying anything like del and deltree do, but it’s still a good trick to know)

Deleting the Recycle Bin folder completely is not a problem because it is recreated as soon as you delete a file.


In my batch-file, I use the above method (which uses the fast, built-in rd command) but also have a few references to external, third-party executable programs:

Synetech
  • 69,547
4

Emptying the recycle bin is what actually deletes the files on file system level, so if that is taking long time, I don't think there's much you can do to it. You can try to minimize the disk usage by other programs, because unnecessarily seeking back and forth slows everything down, but that's about it.

The maximum capacity of the recycle bin is limited to certain percentage of the disk, so emptying it should never take hours. It does not help right now, but you might want to make sure your disk is defragmented at least weekly, if not daily. In Windows 7 you can schedule the defragmentation this way.

The only reasons I can think why emptying would take hours is having lots of very small files on very fragmented disk, or some program interfering with the process. Or disk/cable having problems causing lots of retries on IO operations.

File system is the part of operating system that keeps track of files and directories, and where they reside on the blocks of the storage device. If you have a directory of hundred thousand files, file system needs to have entry for each of them, to make browsing and accessing the directory reasonably fast, to know where the data of those files is stored on device blocks, and to know who is allowed to access them. Every time a file is added or removed, all this data needs to be updated, so that we know that some parts of the storage device are now free for others to use.

Zds
  • 2,469
0

What might help is closing all Explorer windows. Seems the OS is trying to update them on each deleted file and that slows things down.

Robert
  • 1