Empty Recycle Bin (with icon matching state)

This is a simple button which empties the Recycle Bin, and where the button's icon changes to indicate if the Recycle Bin is empty or not.

It uses the Windows Recycle Bin icons from shell32.dll. (Icon IDs 31 and 32.)

The "full" icon is the button's default image. Within the command, the @icon modifier is used to override the icon when the recycle bin is empty.

  • RECYCLEBINEMPTY is a special condition built in to Opus for exactly this purpose. But you can also test for things like variables set by commands and scripts.

  • Remove the FORCE argument from the last line if you'd like to see a confirmation dialog before anything happens (assuming you have Windows set to confirm emptying the recycle bin).

  • Add the QUIET argument to the last line if you'd like to prevent any progress dialog while the recycle bin is being emptied.

  • Tip: When editing a button which uses @icon, hold Ctrl and click where it says @icon to open an image picker, so you don't have to manually work out the path and icon ID.


See also:

An older way of doing something similar was posted here:


Very cute! Interesting info, too.

(The .dcf ruins the show by differing slightly from the screenshot)

I think the only differences are the Large Icon and Show Label checkboxes. I must've changed those between saving the two files. :slight_smile:

To disable the button's action when the recycle bin is empty, add this line before the Delete command:


Resulting in:


For usabilty, it is mainly a visual clue, because it only prevents emptying an empty recycle bin.

Adding to @Leo's tip about holding Ctrl and clicking the @icon line, you can also double-click the @icon line to open the image picker.


There is no need. The icon of the recycle bin is automatically set according to the status of the recycle bin. The status of the recycle bin can be easily seen from the icon. This is the biggest feature of this button.

It's nice with Windows 10 where the recycle bin icons are quite hard to tell apart. :slight_smile:

1 Like

The button no longer works with version 12.31.

No longer works in what sense?

I'm still using it here and it works fine. Nothing related to it changed in 12.31 that I can think of.

I just did the update to version 12.31 yesterday. And now the button no longer works. I have deleted files in the recycle bin. I click on the icon and nothing happens.

Do other methods of emptying the recycle bin work?

Do they work in Opus, or only outside of it? If only outside, I would suspect something blocking the operation (e.g. antivirus). If it doesn't work anywhere then the problem is with the recycle bin rather than Opus.

The default Windows icon on the desktop works. It just does not work in Opus

ok, I reboot my system and now it works again.

But thanks for the quick replay

One more question:
Can the button be modified so that the recycle bin is opened when the right mouse button is clicked?

You could do that with a Multi-Function Button (aka "Three Button"), but you would lose the icon changing to indicate if the bin is empty or not.

ok thank you.
and thanks for the button. I use the button for two years and it works great