The Surly Admin

Father, husband, IT Pro, cancer survivor

Remove Empty Directories Recursively

An interesting problem came up at Spiceworks the other week, and it was all about deleting empty directories.  Locating empty folders and removing them is actually pretty easy but the complication comes when you have nested folders, all of which are empty.  The most obvious scripting method doesn’t work in that regard.  Let’s see how I accomplished this task.

Continue reading


January 7, 2013 Posted by | PowerShell, Powershell - Performance | , , , , , , | Leave a comment