2

I select the following option to set the "Read Only" flag at the folder level and to cascade this flag setting to all of the descendant objects...

enter image description here

When I check the files after initiating this command, they of course all have the read only flag set. However, when I check the folder, I see the Read Only flag check box appears in "Mixed state" even though all of the files have the flag set.

enter image description here

I know that Read Only is a property of a file, but is it also a property of a Folder? The Dialog box suggests that it is. However, why is the check box appearing mixed when I display the Read Only property of the folder? All of the files in this folder had there Read Only flag set, so the check box could not be representing a mixed status of the files within the folder.

It looks to me as though this check box is just used as a quick way to cascade the flag setting down, but the dialog box asks me if I "want to set it to the folder only" which confuses me since it does appear to work as though it is a property of the folder.

1
  • 1
    The read-only flag is a property of a folder, but the GUI does not treat it as one. Consider using the attrib command line tool instead. Nov 28, 2012 at 3:45

3 Answers 3

3

According to http://support.microsoft.com/kb/326549,

Unlike the Read-only attribute for a file, the Read-only attribute for a folder is typically ignored by Windows, Windows components and accessories, and other programs. For example, you can delete, rename, and change a folder with the Read-only attribute by using Windows Explorer.

Also,

Windows Explorer does not allow you to view or change the Read-only or System attributes of folders.

See also:

Folder keeps changing back to read-only. What permissions setup causes this in Windows?

Windows 7 / 64 bit: Folder stays write protected after change

Windows XP doesn't actually recursively change attributes

2
  • 1
    Actually the article in question is slightly misleading. The read-only attribute does prevent a folder from being removed from the command line. It also prevents Explorer from removing the folder if the user doesn't have the permission necessary to remove the flag; see, for example, superuser.com/a/505292/96662 Nov 28, 2012 at 3:44
  • 1
    True, and there are also MS articles around folders that have the attribute set. I got the impression that the question was more about the GUI behavior than the attribute applying to folders. Maybe I'm wrong; it's happened before. ;) Nov 28, 2012 at 10:17
2

In Windows, GUI does not display whether the folder has Read-only attribute set or not. The check box of Read-only attribute is always in mixed/undetermined position. In Windows 7, there's a note Only applies to files in folder next to Read-only attribute:
Users properties: Read-only attribute in undetermined stated with note “Only applies to files in folder”

You can check whether the attribute is set by using attrib utility:

C:\>attrib Users
     R       C:\Users

This Read-only attribute on folders has a special meaning for Windows Shell, Explorer: it makes it read desktop.ini in the folder, if it exists.

You check it by playing with Read-only attribute on My Documents folder, for example:

attrib -R "My Documents"

The icon of My Documents will become regular folder icon. To restore it, run

attrib +R "My Documents"

 
As other answers already said, Windows GUI allows removing a folder even if its Read-only attribute is set, although command-line rmdir cannot delete it if the folder is Read-only:

mkdir test
attrib +R test
attrib test
     R       test
rmdir test
Access is denied.

attrib -R test
rmdir test

The folder test is removed now.

8
  • Not true. i.imgur.com/cCaLW.png Nov 28, 2012 at 18:41
  • 1
    @IsaacRabinovitch If I click Read-only check box several times, it will display a tick in it. But whenever I open new Properties, then Read-only attribute is always in indeterminate state. Even more, if I click Apply, the option Apply changes to this folder only is disabled (in Windows 7/8) when I select or clear Read-only attribute. If I select/clear Hidden attribute, Windows allows me to apply changes to the folder only. Nov 28, 2012 at 20:44
  • 2
    @IsaacRabinovitch: the hidden value works as you might expect, as far as I know. It's only the read-only value that the GUI treats oddly for directories. Nov 28, 2012 at 22:32
  • 1
    @Harry: I agree with your last comment. Even the ATTRIB cmd, not just the GUI, fails to display the value of the folder RO flag. No issues with the Hidden flag.
    – Ivan
    Nov 29, 2012 at 3:10
  • 3
    @Chad: the attrib command works for me, the read-only flag is displayed correctly for a directory. Nov 29, 2012 at 3:23
0

Yes, a folder/directory has its own read/write permissions. Modern OSs (including Windows) tend to imitate the Unix directory concept, where the directory is just a file with special restrictions on how it can be modified. Notice that the dialog you used says "Apply changes to folder, subfolder, and files." (Italics mine.)

Which doesn't answer the important part of your question: why are your permissions still mixed?

7
  • 2
    -1. Since flags and permissions are different things in Windows, this doesn't address the question. Nov 28, 2012 at 22:36
  • 2
    In Windows, every file and directory has four flags which may be either set or clear: read-only, archive, system, and hidden. Although the read-only flag has security implications under certain rare circumstances, these flags are distinct from the file system permissions. The OPs question is about the read-only flag, and is only indirectly related to permissions. Nov 29, 2012 at 1:01
  • 1
    The proper name for these four flags is "attributes" BTW. Of course attributes and permissions aren't mutually exclusive, but they are distinct. The article you reference doesn't mention the attributes at all as far as I can see, what does it have to do with anything? Are you confusing attributes with ACE flags? Nov 29, 2012 at 2:47
  • 2
    (Note, for example, that the FAT file system has attributes but no permissions.) Nov 29, 2012 at 2:48
  • 2
    @IsaacRabinovitch These four attributes have nothing to do with permissions. Although when Read-only attribute is set on a file, the system denies writes to it despite you have write permissions to it. Read-only attribute was used to prevent overwriting and deleting an important file accidentally on FAT because it lacked permissions. Nov 29, 2012 at 6:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .