Finding empty folders

Feb 12, 2020
4
0
At work we try to find empty folders because we need to fill them, not delete them. Does anyone know a script to find folders with no files in it? I don't care if they have sub folders, I just want folders with no files. Any ideas?
 
Feb 12, 2020
4
0
I have a network folder I mapped to Z that has 22 folders and half of them have sub folders and i need to find the empty folders in my Z drive, is there a script that can return a list of empty folder paths?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,026
55
Albuquerque, NM
prospero.unm.edu
You could try something like this:

Code:
pushd Z:\
global /h /i /q if %@files[.,-D] == 0 echo %_cwd
popd
Sorry, I haven't done much testing. But you get the basic idea.
 
Feb 12, 2020
4
0
I am using windows 7, I tired that and got
'global' is not recognized as an internal or external command, operable program or batch file