Easy way to remove all empty sub-folders using the command prompt (Robocopy)

There are several ways to accomplish this but I have been using this method for a while and seems to be the easiest one; it is very fast too. Just go to the command prompt and navigate to the root of the folder you want to work on and use:

ROBOCOPY folder1 folder1 /S /MOVE

As you can see, we use the same name of the folder as the destination folder too. What this command actually does is move all the content to a folder with the same name but it skips the empty folders (remove them).

No Comments Yet.

Leave a Comment

 

%d bloggers like this: