Skip to content

WebNinjaDeveloper.com

Programming Tutorials




Menu
  • Home
  • Youtube Channel
  • Official Blog
  • Nearby Places Finder
  • Direction Route Finder
  • Distance & Time Calculator
Menu

Python 3 Script to Empty Recycle Bin Automatically Using Winshell Library in Windows on Command Line

Posted on February 11, 2023

 

 

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

 

 

Python
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

 

 

 

Recent Posts

  • React.js Twitter API Tutorial to Embed Profile & Timeline, Hashtags of User in Browser Using Javascript
  • Android Java Tutorial to Change Styles & Visibility of System Bars (Top, Action & Status) Full Example
  • Android Java Project to Display & Play Audio Files From Storage inside ListView Using MediaPlayer Class
  • Android Java Project to Build MP4 Video to MP3 Audio Converter Using MediaMuxer Class
  • Android Java Project to Merge Multiple PDF Documents From Gallery Using iTextPDF Library
  • Angular
  • Bunjs
  • C#
  • Deno
  • django
  • Electronjs
  • java
  • javascript
  • Koajs
  • kotlin
  • Laravel
  • meteorjs
  • Nestjs
  • Nextjs
  • Nodejs
  • PHP
  • Python
  • React
  • ReactNative
  • Svelte
  • Tutorials
  • Vuejs




©2023 WebNinjaDeveloper.com | Design: Newspaperly WordPress Theme