Skip to content
⌘ NSIS Forum Archive

Recursive delete

5 posts

ccleve#

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.
kichik#
RMDir has /r. Just be careful with that... Make sure you are not deleting something you wouldn't want to.
philoo#
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.