Why is the readonly property for folders so strange?

It's actually a signal to Explorer to look harder. It doesn't mean that the directory is read-only.

If a folder has the Readonly or System flag set, then Explorer will look for a desktop.ini file which describes the folder customizations. For performance reasons, Explorer does this only if the directory has the +R or +S flag. (This is enormously important on slow networks.)

There are two KB articles on this subject, and I will defer to them for much of the discussion. This is the version that applies to Windows XP and Windows Server 2003. There is also a version that applies to older versions of Windows, although the UseSystemForSystemFolders policy still applies.

Coders shold use the function PathMakeSystemFolder to mark a folder as requiring special attention from Explorer.

Comments (10)
  1. RJ says:

    I love this site … so many interesting updates. I’m learning lots from all of this, please keep it up :)

  2. Lee Alexander says:

    Carry on with the good work I thoroughly enjoy reading your articles just before I start work :-) BTW are you doing any PDC talks?

  3. Serge Wautier says:

    Speaking of slow networks, I’ve recently setup a VPN between our headquarters and a foreign subsidiary. My experience is that using Windows Explorer to connect to a shared drive over the VPN is practically impossible : waaaaaaaay too slow, especially when one (single-)clicks a file. I assumed it’s because Windows collects data about the file (e.g.: title and author displayed in the status bar if it’s a word doc).
    On the other hand, connecting through a console window (net use blah…) works very well (in terms of performance, not in terms of usability…)
    Is there any ‘Use slow connection’ mode for access to network drives by Windows Explorer, a bit like the same option in RAS ?

    And of course, it must be written because it’s just too easy to think it and never say it : Thanks so much for this blog, Raymond ! Keep up with the good work.

  4. Israel says:

    That was one of the most perplexing behaviors I had encountered in Windows! Thanks for explaining. I know I’ll feel like a hotshot next time I’m explaining it to someone.

  5. John Topley says:

    This seems very strange to me. Why can’t it do what it says on the tin i.e. if read-only is checked then any existing files within that folder should be made read-only, as should future files added to it.

  6. Gleb Dolgich says:

    Can you give any insight on why icon handlers are ignored for folders?

  7. Mark Hurd says:

    Serge: Given what I’ve seen as a developer, a left click seems to build the whole contect menu you’d expect to see with a right click, then choose the default menu item. If you have things like WinZip and such that need to review the content of the file to determine what menu items to offer this can be rather slow.

  8. KJK::Hyperion says:

    Mark: that’s exactly how it works. The shell builds an off-screen context menu and "clicks" the default item. Shell extensions are supposed to make their additions to the context menu quickly, of course. Read about IShellFolder::GetUIObjectOf, IContextMenu::QueryContextMenu and IContextMenu::InvokeCommand

  9. Raymond Chen says:

    Commenting on this entry has been closed.

  10. There is an alias at Microsoft that is the front line for the Shell team, the one place where the important…

Comments are closed.

Skip to main content