We have a 6 year old post with replies till recently including answers that were helpful. Since Windows 10 File Explorer no longer works for empty directories, here I am working around Microsoft bugs, documenting their bugs, and posting a work around. Here
are my notes.
Microsoft once again has broken software in Window 10 for doing a common needed function, REMOVING EMPTY FOLDERS. There are all kind of ways to end up with lots of empty sub folders in a folder. Separating
pictures and videos in a massive picture folder was my case. The following are the two Microsoft ways that should work, followed by a free and good program that actually works. I include the broken ways assuming they will be fixed some day. Also to help others
and share what wasted so much of my time.
Using the File Explorer is what absolutely should work. Go to the folder, go to the search box, pick “kind” in the search choices and pick “folder”, then pick “size” in the search choices and pick “empty”.
Unfortunately once you pick “empty” you get nothing. Before it was broken you would get all the actual empty ones and you could delete them.
Using a command line is an old style and rather technical way that should work too. You basically use a command line script to find all directories and do a rd (rmdir) on each which will only remove
empty ones. The broken part is that it says the empty folders show up as not empty. I certainly won’t bother with explaining the options or why you need to reverse sort the order. Here is the script to be run from the prompt at the directory (folder).
for /f "delims=" %d in ('dir /s /b /ad | sort /r') do rd "%d"
If you put it in a batch file you will need these processing characters.
for /f "delims=" %%d in ('dir /s /b /ad ^| sort /r') do rd "%%d"
NOW for what you can do till Microsoft fixes its bugs. Go to the link below and install the program. If the link gets removed or disappears in the future, search for “remove empty directories”. It downloads
a file named “red-v2.2-setup.exe”. I’d save it away since it is now free and works.
Remove Empty Directories
https://sourceforge.net/projects/rem-empty-dir/
Worked great as of 20171112