Welcome folks today in this blog post we will be writing the python script
to empty the recycle bin
using the winshell
library in windows on command line. All the full source code of the application is shown below.
Get Started
In order to get started you need to install the below library using the below command as shown below
pip install winshell
And after that you need to make an app.py
file and copy paste the following code
app.py
1 2 3 |
import winshell winshell.recycle_bin().empty(confirm=False, show_progress=False, sound=False) |
As you can see we are importing the winshell
library at the top and then we are using the empty()
method to delete all the files present inside the trash
and the recycle bin as shown below