Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
Other than 'del'? – pelms Aug 18 '09 at 16:50
Which OS are you using? – ChrisF Aug 18 '09 at 16:51
exited to add XP and Vista – justintime Aug 18 '09 at 16:59
@pelms del permanently deletes it, not moves it to the recycle bin. – MiffTheFox Aug 18 '09 at 17:02
Then you must think there is no reason to have the Bin at all. By your logic, why recycle files from Explorer instead of just deleting them permanently? You may not have seen a use, but they do exist. Just recently, I wanted to delete a pile of files from numerous folders, but wanted to double-check them before wiping them out. The only/easiest way to do it was to run a for loop from the command-prompt to send them to the bin, then I could see them all consolidated in one place to make sure that only the files I wanted to delete were in there and restore any incorrect files. – Synetech Oct 3 '12 at 0:32
up vote 23 down vote accepted

CmdUtils has a utility called Recycle that does exactly that. [direct download]

More info:

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.

share|improve this answer

If you have powershell installed:

$sh = new-object -comobject "Shell.Application"
$ns = $sh.Namespace(0).ParseName("PATH\TO\FILE\TO\DELETE")
share|improve this answer
+1 Any powershell solution will get my vote. I hope the next Windows replaces cmd.exe with PowerShell. – BinaryMisfit Aug 18 '09 at 17:31
I doubt that will happen for a very long time. :) – EBGreen Aug 18 '09 at 17:31
That is far too slow, especially if recycling a lot of files (e.g., the PS counterpart to for /r %i in (foobar.tmp) do recycle "%i"). – Synetech Oct 1 '12 at 2:40

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.

share|improve this answer
I just ran it on Windows Server 2008R2 and it doesn't work. – dthree Mar 30 at 20:49

All answers suggest to use third-party tools but you can use simple move you just need to determine correct recycle bin path.

In XP it is C:\RECYCLER, in Vista and later C:\$Recycle.bin. However that is not everything, it is just a main folder but it contains sub-folders and these are actual bins where you need to move your file.

For example, in my machine that path is:


share|improve this answer
I can't use DIR on this path. Are you sure this is the right solution? – André Neves Apr 16 '15 at 3:34

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
share|improve this answer

I tried various programs for moving a file(s) to the recycle bin, but was unsatisfied with them for various reasons.

The main problem most have is the lack of decent status or error messages. Some just fail silently, so you think the program recycled something but in fact didn't do anything at all!

To remedy this, I've written a command line utility called bin-it that moves the specified file(s) to the Windows recycle bin. It supports wildcards and provides full status and error reporting. If something goes wrong, you'll know about it!

It's completely free and can be downloaded from here as

share|improve this answer

Can use external utility:

nircmd moverecyclebin *.tmp

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.