Move/Copy switch not make empty destination sub-folders

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,398
83
Albuquerque, NM
prospero.unm.edu
The problem is that it's difficult to know ahead of time which ones will be empty. Consider recursion, advanced wildcards, ranges.... You kind of have to create directories which don't exist as you go.

I would suggest a different approach. Remember the names of all directories which are created, say in a linked list. Then, after the COPY or MOVE finishes, try to remove all of them — in reverse order, inside-out. Newly created directories which are still empty will be removed. Newly created directories which are not still empty will fail, but that's okay; just silently ignore the error and carry on.