On Fri Aug 23 21:25:53 2024 +0000, Elizabeth Figura wrote:
What was the point of adding it in the first place?
Because the `SetFileAttributes` call is not super important, it's there to remove the READONLY attribute that might be present. But it can also block `RemoveDirectory`/`DeleteFile` from working if the user only has DELETE rights and not FILE_WRITE_ATTRIBUTES.
The actual use case for this (on Windows) is deleting a shortcut on the %allusersprofile% desktop. Some installers will create a shortcut there with DELETE access allowed for the everyone group.