Archive: Recursive delete


Recursive delete
How do I delete a directory and all subdirectories?

It appears that the Delete command does not have a /r switch like the File command.

I use the File /r on install, and I'd like to do a Delete /r on uninstall without naming all directories explicitly. The reason is that there are a very large number of subdirs, and they change from version to version and I'd rather not have to maintain the list.


how about the RMDir command? tried that?


RMDir has /r. Just be careful with that... Make sure you are not deleting something you wouldn't want to.


indeed, you can use the RmDir /r command
but if you want to completely remove the directory, you should use:
RmDir /R

It tooks me a while to find this option.


NSIS is case insensitive. RmDir /r and RmDir /R do the exact same thing.