If you want to delete all empty folders and sub folders recursively from D:\FTPROOT then here is the ready to use syntex with an example:
Syntex = Prompt:> Drive:\Delete_empty_folders_directories.bat
Example = C:\Delete_empty_folders_directories.bat
for /f "usebackq delims=" %%d in (`"dir /ad/b/s D:\FTPROOT"`) do rd "%%d"
Recommended to use this DOS batch script file after delete all old files not accessed after XX days.