Skip to content
⌘ NSIS Forum Archive

Remove folders recursively only if they're empty

5 posts

fabiochelly#

Remove folders recursively only if they're empty

Hi,

Is it possible to a folder which can contains other folders (etc.) but ni files in it.

In fact my problem is that "RMDir /r" removes recursively but even if there are files in it.
"RMDir" removes only if the folder is compeletely empty (even if it has empty folders).

What I would like is to remove recursively my folders if they doesn't contain any files
Joost Verburg#
First use RMDir for the folders inside the folder and then remove the folder itself.
Joost Verburg#
Then you will have to check wheather there are files inside. The search functions in the NSIS Archive might help you.