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.

6
  • 8
    Yes, a very quick one: format your drive.
    – user541686
    Aug 7, 2011 at 18:20
  • @Pekka - So, it's been a day. Did it actually take 4 hours? Aug 9, 2011 at 0:07
  • 3
    @Mehrdad wouldn't that take much longer?
    – Pacerier
    Aug 11, 2011 at 7:03
  • 0.5M files‽ o.O That’s quite a bit. After ~20 years of extensive computer use, I only have ~300K files across all the volumes in my current system (not counting my thousands of floppies or other drives). Can you say what the heck was in that folder?
    – Synetech
    Aug 22, 2011 at 0:09
  • @Synetech a dozen versions of a large CMS with thousands of asset files and JavaScript widgets each, on top of it all under SVN version control (which adds control files for each one)
    – Pekka
    Aug 22, 2011 at 5:50

7 Answers 7

25
+100

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.

5
  • 4
    Interesting, but this wouldn't work on my Windows 7 64-Bit! I started the tool with admin rights, it ran for a few seconds and exited, but no change in the bin.
    – Pekka
    Aug 21, 2011 at 14:05
  • 2
    Update: This did work after all, it just took a few minutes for the explorer window to update! Thanks. (I can't award the bounty yet.)
    – Pekka
    Aug 21, 2011 at 14:09
  • 6
    > I've seen it run very quickly even with my Recycle Bin containing ~1 GB of data. The size is irrelevant, what matters is the number of files.
    – Synetech
    Oct 1, 2012 at 2:11
  • @Synetech: True. I just didn't count, as there were folders there as well.
    – Isxek
    Oct 2, 2012 at 23:45
  • I had to make sure NOT to run this utility as administrator, and NOT to run it from an admin-level command prompt. It seems like it runs in a user-specific way. Mar 28, 2019 at 21:35
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)

5
  • 5
    Good tip! This triples the rate at which files are deleted. It's still very slow but definitely an improvement.
    – Pekka
    Aug 7, 2011 at 18:50
  • 2
    @Moab: same here
    – surfasb
    Aug 8, 2011 at 1:13
  • 1
    You should disable on-access and only let it scan on-write. :) Aug 22, 2011 at 23:37
  • @Moab same here buddy........
    – avirk
    Aug 25, 2011 at 18:28
  • 3
    Thanks for the votes guys, you got me the rare Populist badge for having twice the votes of the accepted answer. Only 23 people ever got that badge :-)
    – Jeff
    Aug 26, 2011 at 19:38
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).

2
  • 1
    Another option is to boot into a Linux live-cd and delete the recycle folder. Aug 7, 2011 at 20:43
  • 2
    No, it will definitely be faster, particularly when there are that many files in the RB because Explorer does some extra house-keeping that the command-line forgoes. You’ll also want to redirect the output to nul to make it even faster.
    – Synetech
    Aug 22, 2011 at 0:06
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.

3
  • The BEST advice so far. I strongly recommend the asker to follow THIS advice
    – gd1
    Aug 21, 2011 at 22:10
  • 2
    You’ll need to make sure to Shift+Del it, otherwise it will try to recreate the Recycle Bin. Plus, if there are that many files in it, doing this in Explorer will still be about the same speed as the Empty command. Using the command-line like Mehrdad indicated (I use rd instead of rmdir, but tomato-tomato), will bypass all the extra work that Explorer does, and delete it much faster, especially if you redirect the output to nul.
    – Synetech
    Aug 22, 2011 at 0:04
  • 1
    It will recreate an empty recycle bin, yes shift + del.
    – Moab
    Aug 22, 2011 at 4:59
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:

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.

4
  • 1
    They are a lot of very small files, that probably is making it slow.
    – Pekka
    Aug 7, 2011 at 18:51
  • +1: "half a million files" will take quite a while to delete, either when pressing 'shift' or when emptying from the recycling bin. Aug 9, 2011 at 0:06
  • I'm not sure what you mean by "on the file system level". Pressing just the delete key issues a move command on the selected file(s). Emptying the recycle bin or pressing Shift-Del actually removes the reference to the file in the file system, but the data is still there until some other files overwrite it. I suppose it's a matter of definition, but I'd consider deleting on the "filesystem level" to mean the actual overwrite of the data by use of disk wipe tool. Aug 24, 2011 at 22:14
  • "File system level" means the files are deleted from directory entries and space allocation records of the file system. Wiping the actual contents would be "block device level".
    – Zds
    Aug 25, 2011 at 7:15
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .