Sunday, October 12, 2008

Perl script to recursively delete empty folders on a volume

  1. Install Perl. ActivePerl is free and can be downloaded from http://www.activestate.com/Products/activeperl/index.mhtml
  2. Create a text file in the root directory and insert the following text

    use File::Find;finddepth(sub{rmdir},'.')

  3. Save and close the file.
  4. Change the extension of the file to ".pl"
  5. Run it to rid your volume of all empty folders.

No comments: