windows 7 - Why is deleting files to recycle bin so much slower than when using Shift+Del with Total Commander?

07
2014-07
  • sashoalm

    When deleting a large directory with Shift+Del (no Recycle Bin), it happens an order of magnitude faster. Why is deleting to Recycle Bin so much slower on Windows? I'm on Windows 7.

    Edit: Just realized that it's because I'm using Total Commander instead of Windows Explorer. Because I always use that program, I had never noticed that from Windows Explorer deleting a directory to Recycle Bin is instantaneous.

  • Answers
  • Levans

    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...


  • Related Question

    windows - What is the command line way of sending files to the recycle bin?
  • justintime

    Is there a command line program that can send files to the recycle bin? This is on XP and Vista.


  • Related Answers
  • slhck

    CmdUtils has a utility called Recycle that does exactly that.

    More info here:

    To use the recycle command download the CmdUtils zip file and unzip the exe to your Windows folder. Adding them to the Windows folder would allow you to access the command globally without you having to specify the entire path to the executable. You can then start using the recycle command by typing in;

    recycle filename.txt
    

    You can also specify wildcards with the commands so typing in recycle *.txt will recycle any text files in the current directory. There is also a option to suppress the delete confirmation dialog by using the force flag with the command.

    To delete a file without having to confirm is use the command

    recycle –f filename.txt
    

    The –f flag will tell the command to force a recycle without showing you the confirmation dialog.

  • EBGreen

    If you have powershell installed:

    $sh = new-object -comobject "Shell.Application"
    $ns = $sh.Namespace(0).ParseName("PATH\TO\FILE\TO\DELETE")
    $ns.InvokeVerb("delete")
    
  • slhck

    I've had this question for a long time -- I finally took the matters into my own hand and I rolled my own utility cmd-recycle

    I took a look at Recycle.exe in CmdUtils. The thing about it is that it pops out the traditional "Are you sure" dialog when you recycle (which can be removed by adding the -f argument). My program just does it (since you can always undo) which I think is more suitable for scripting purposes.

  • Synetech

    There is no built-in way to do this, but there are third-party tools that can. I checked my program-dump folder and found a few options. They all work the same (e.g., recycle filename.ext), but they vary in performance, so it depends on what your needs are (e.g., are you recycling a lot of files?)

    • MaDdoG Software’s Recycle is fast and has no output, but can throw a mysterious not-found error
    • EasyTools’ DeleteXP is slow because it displays the progress to the console, but if you redirect it to nul, then it is the fastest and reliable
    • Chris Yuen’s cmd-recycle is slowest, even when redirecting the (poorly formatted) output to nul