Unable to remove read-only attribute for folder on Windows

Recently I ran into a little problem when trying to remove the read-only flag from a folder to be used as data store for a web application. Trying to remove the read-only attribute via the folder settings did not do the trick, as after unchecking the box, closing the settings...