Windows and applications create many blank folders on your hard drive in time. And they stick even after you uninstall the software. To solve this issue of ghost folders, I created a simple python script to delete all empty folders in any given drive or folder path. Here is the code;



Usage

For this script to work, of course you need python to be installed on your computer.

Usage of the script is very simple:

  1. Open up a terminal/command prompt and navigate to the folder containing rmblanks.py script.
  2. Type rmblanks.py E:\Directory\Name\ToBe\Cleared
  3. Change E:\Directory\Name\ToBe\Cleared to any folder you want to clear.
  4. Depending on hard drive speed and levels of directories, this script may take some time to complete.

Hope you found it useful. Enjoy!