Windows – Is it possible to make a read only directory in windows XP

directorypermissionswindows

According to http://support.microsoft.com/kb/326549 the read only attribute is typically used for reasons other than marking a folder as actually read-only. Therefore it seems to me that it is not possible to make a directory read only in the same sense as linux using
chmod a-w.

Best Solution

Interesting, I didn't know that! I just tried it, you can set the readonly attribute on a folder with the attrib command, but it has no effect.

The only alternative I see is setting the access rights to the directory based on the user account, if it is on an NTFS formatted drive. Have a look at the Xcacls tool from Microsoft.

Take care though, access permissions on NTFS are a good deal more complex than unix type access control. In general it's better to not allow a specific kind of access, than to deny it. I think this is no longer a problem today, but I remember back on good old NT 4, a freind of mine managed to deny all access to a folder, including the administrator account. He couldn't do anything afterwards, not even delete it...