All folders are read-only

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #11

    NoelDP said:
    Folders CANNOT be read-only
    Careful what you say there. Folders can have the read-only attribute set, though it is impossible for a user to set the read-only attribute on a folder through Windows Explorer.


    Higgins, a read-only attribute on a folder does virtually nothing to the folder anyway. Nothing you need to concern yourself with.

    From my observations, this blue blob in the properties of a folder is always blue; it has no meaning whatsoever.


    The following batch file lists all folders (starting from C:\Users\%username%) that have the read-only attribute set.
    Code:
    @echo off
    setlocal EnableDelayedExpansion
    pushd "C:\Users\%USERNAME%"
    for /f "delims=" %%I in (' dir /s /b /a:d ') do (
    	for /f "delims=" %%G in (' attrib "%%~I" ') do (
    		set _=%%G
    		echo "!_:~0,13!" | find "R" >NUL && echo %%I
    	)
    )
    popd
    pause
      My Computer


  2. Posts : 21,482
    Win 7 x64 Home Premium (and x86 VirtualBox VM)/Win10
       #12

    Folders DO NOT HAVE a read-only attribute - so it cannot be set.
    The only way to deny write access to folders is to specifically exclude write permissions.
      My Computer


  3. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #13

    Folders CAN HAVE a read-only attribute - but it cannot be set through Explorer.
      My Computer


  4. Posts : 21,482
    Win 7 x64 Home Premium (and x86 VirtualBox VM)/Win10
       #14

    ...and it can't be set by command-line either because Windows folders do not have the capability. The flag may be present, but has no effect on the file contents of the folder or the folder itself..
      My Computer


  5. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #15

    NoelDP said:
    ...and it can't be set by command-line either because Windows folders do not have the capability.
    The command line can indeed set the read-only attribute onto a folder.

    Code:
    C:\Users\Username\Desktop>md NewFold
    
    C:\Users\Username\Desktop>attrib NewFold
                 C:\Users\Username\Desktop\NewFold
    
    C:\Users\Username\Desktop>attrib NewFold +r
    
    C:\Users\Username\Desktop>attrib NewFold
         R       C:\Users\Username\Desktop\NewFold
    
    C:\Users\Username\Desktop>rd NewFold
    Access is denied.
    
    C:\Users\Username\Desktop>attrib NewFold -r
    
    C:\Users\Username\Desktop>rd NewFold
    
    C:\Users\Username\Desktop>

    NoelDP said:
    The flag may be present, but has no effect on the file contents of the folder or the folder itself.
    Yes. The read-only attribute on a folder is generally ignored by Windows. The read-only flag on folders is used for other things.
      My Computer


  6. Posts : 5,642
    Windows 10 Pro (x64)
       #16

    For folders the read-only attribute is used to give Windows Explorer a hint that a "desktop.ini" file is within the directory and that it should use it. Removing the read-only attribute from a folder like "My Documents" effectively turns off the "desktop.ini" file customization for that folder. Concerning the read-only checkbox in folder properties. If one bothered to read it, it clearly states: "(Only applies to files in folder)" and no matter what you do, the checkbox will always have a solid indicator.
      My Computer


  7. Posts : 4,049
    W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
       #17

    Pyprohly said:
    NoelDP said:
    ...and it can't be set by command-line either because Windows folders do not have the capability.
    The command line can indeed set the read-only attribute onto a folder.

    Code:
    C:\Users\Username\Desktop>md NewFold
    
    C:\Users\Username\Desktop>attrib NewFold
                 C:\Users\Username\Desktop\NewFold
    
    C:\Users\Username\Desktop>attrib NewFold +r
    
    C:\Users\Username\Desktop>attrib NewFold
         R       C:\Users\Username\Desktop\NewFold
    
    C:\Users\Username\Desktop>rd NewFold
    Access is denied.
    
    C:\Users\Username\Desktop>attrib NewFold -r
    
    C:\Users\Username\Desktop>rd NewFold
    
    C:\Users\Username\Desktop>
    Agreed.

    Once you have set "Read-only" on a folder using the Command Prompt, Windows Explorer will indicate that it is "Read-only" in the Attributes column in Details view.
    All folders are read-only-we-showing-folder-read-only.png
    Last edited by lehnerus2000; 22 Feb 2015 at 08:09. Reason: Additional
      My Computer


  8. Posts : 21,482
    Win 7 x64 Home Premium (and x86 VirtualBox VM)/Win10
       #18

    ..but if you actually test id, the folder is NOT read-only, and it's posdible read and write it without restriction.
      My Computer


  9. Posts : 4,049
    W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
       #19

    NoelDP said:
    ..but if you actually test id, the folder is NOT read-only, and it's posdible read and write it without restriction.
    That's true for Windows Explorer (which is why I wrote "indicate").
    I haven't checked to see if it is true in the Command Prompt.

    Pyprohly's code suggests that the Command Prompt behaves differently.

    The way Windows 7 handles "Read-only" is one of my biggest gripes.
      My Computer


  10. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #20

    Is anybody having a problem with a read only folder?
    If so can you open the folder and have your way with the files in the folder?

    I'm trying to understand what problem is needing fixed and why.
      My Computer


 
Page 2 of 3 FirstFirst 123 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:08.
Find Us