Welcome!

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

SignUp Now!

Finding empty folders

Feb
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?
 
If a directory is empty, then %@files["dirname",-D] should return 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?
 
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.
 
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
 
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

Wait, what? That's a CMD‍.EXE error message. You're not running Take Command?
 
Back
Top