The program has to test if it deletes the file. If the file is marked read only, the program doesn?t delete it, and then program cannot delete the directory.
More: Do you verify the locking of a file by other apps and do a reboot-and-delete?
More: Do you verify that registry keys are deleted?
More: Ask when a directory contains more files than installed and ask to delete it.