Delete empty directories

posted Oct 22, 2015, 10:09 AM by Ezra Kenigsberg
Q: "How do I delete all the empty directories on my hard drive?"


How's it work? Basically, you're
  1. listing all directories on the hard drive, in reverse order, in a new file, then
  2. tweaking that file to remove all directories. (Windows' Command Prompt will skip any directory that has files in it).
Because the files are listed in reverse order, any subdirectories are listed before their parent directories. Smart!
Comments