Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Done Move/Copy switch not make empty destination sub-folders

Apr
1,794
15
>MOVE /s source\*.txt dest\

would make empty dest subfolders. Be great to have a switch for MOVE and I assume COPY not to make empty dest sub-folders....

See question re: Move for more details
 
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.
 

Similar threads

Back
Top