I tried to write a batch script for the windows commandline yesterday to do the job. It worked in a test-directory. However, when I applied it to my actual folder, I accidentally deleted quite a few files I did not want to delete. Dang! It's probably got something to do with the data type used in batch-variables and overflows thereof. In case any batch-script pros lurk around, here's my script:
Code: Select all
echo Deleting empty folders...
setlocal EnableExtensions EnableDelayedExpansion
for /D %%F in (*) do (set /a "size=0" & (for /r %%g in (%%F\*) do (set /a "size=!size!+%%~zg")) & IF !size! LSS 100000 rmdir /S/Q %%F)