Skip to content
⌘ NSIS Forum Archive

Why RmDir does not delete empty folders

4 posts

theflashback#

Why RmDir does not delete empty folders

After hours paying with RmDir, I finally realized that if you

SetOutPath "c:\blah"

#...
# do something
#...

RmDir "c:\blah"

C:\blah won't be deleted even if it is empty because RmDir thinks that c:\blah is still in use since SetOutPath still points to it...

Basically if you cannot delete empty folders for some
reason, make sure SetOutPath points to $SYSDIR for example:

SetOutPath "c:\blah"

#...
# do something
#...

SetOutPath "$SYSDIR"
RmDir "c:\blah"


Hope it helps...
zimsms#
You can place the final remove statement into the runonce registry hive so it is removed on startup.
VegetaSan#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


check that.