
Here's the code: RMDirIfNotJunction 1.0 () The eventual goal is to consider replacing RMDir calls within launchers to check for the niche users that intersperse junctions within APPDATA. I've put together a quick function that is a drop in replacement for RMDir that will remove the directory buy only after it is checked to see if it is a junction. Unfortunately, due to junctions being junctions, they report as empty even though the directory they point to has things in it because the directory referenced doesn't have anything in it because it doesn't exist. What happens? As NSIS uses standard Windows calls, it checks to see if a given directory is empty before removing directory for commands like RMDir. Junctions on Windows are incredibly buggy and probably shouldn't be used. Personally, I avoid junctions and recommend against them full stop. Some users prefer to use junctions, though. For apps like Firefox and Thunderbird, the best way to do this is to use the built-in profile manager to point to a profile on your secondary drive. Why do this? Some users use junction points within APPDATA to redirect specific directories to other drives for their local apps.

Essentially, it's an RMDir (without the /r) but checking to see if the directory referenced is a REPARSE_POINT first. I'm testing an NSIS function that will remove an empty directory after checking if it is a junction.
