I’m trying to clean up empty directories in a nested folder structure.
The following code isn’t working reliably:
for each f as FolderItem in folder.Children
if f.IsFolder and f.Count > 0 then
CleanUpEmptyFolders(f)
end if
if f.IsFolder and f.Count = 0 then
f.Remove
end if
next
I thought perhaps Folderitem.Count also counts hidden files but I don’t see any when I view hidden files.
Is there a better approach?
~
Thanks