A simple command-line tool to manage the Windows Recycle Bin (Windows) using Python.
Features interactive mode, listing, restoring, deleting, and cleaning the recycle bin, with a colorful interface.
- List all items in the Recycle Bin with date, name, and full path.
- Restore or permanently delete items by number, range, or list.
- Clean (empty) the entire Recycle Bin.
- Interactive mode with search/filter by filename.
- Colorful output using
rich.
- Python 3.7+
- rich
- rich-argparse
- winshell (Windows only)
Install dependencies:
pip install rich rich-argparse winshellpython recyclebin.py [options]-
-l,--list
List contents of the Recycle Bin. -
-c,--clean
Clean (empty) the Recycle Bin. -
-i,--interactive
Start interactive mode.
You will see a list of items in the Recycle Bin and a prompt:
please select number, [n]r = to restore number, [n1-nX]r to restore number n1 to nX, n1,n2,n3..r = to restore number n1,n2,n3,...,[n]d = to delete number, [n1-nX]d to delete number n1 to nX, n1,n2,n3..d = to delete number n1,n2,n3,..., [c] = clean/clear recycle bin, [q]uit/e[x]it = exit/quit or just type any to search/filter what you want:
1r— Restore item number 12-4d— Delete items 2 to 41,3,5r— Restore items 1, 3, and 5c— Clean (empty) the Recycle Binqorx— Exit interactive mode- Typing any text — Filter/search items by name
MIT License
Note: This script works only on Windows, as it uses the winshell library.
