The Read Only flag is half checked for a folder and I'm unable to remove it, (it just comes back) and my .net web application is unable to access this folder.

Attrib command doesn't work.

Taking ownership of the folder doesn't work.

Ideally I need a command line command as I need to automate this.

There seems to be lots of versions of this question but nothing for Server 2012.

2 Answers 2


Remove file read-only attribute

  • ATTRIB -R "<Filename>"

Take ownership of a folder

  • TAKEOWN /F "<foldername>" /R /D

Remove folder read-only attribute

  • ATTRIB -R /D /S "<Foldername>"

You might also look into granting explicit NTFS permissions with command line ICACLS.


:::: Disables ACL inheritence on *.txt files ONLY beneath folder listed but COPY all ACLs as inherited before removing
::: show errors but supress prompting
ICACLS "T:\folder\*.txt" /inheritance:d /grant:r "domain\username:(OI)(IO)" /C

:::: Remove all GRANTED permission ACLs on ONLY *.txt files beneath listed directory
ICACLS  "T:\folder\*.txt"  /remove:g "domain\username" /C

:::: Remove all DENIED permission ACLS on ONLY *.txt file beneath listed directory
ICACLS  "T:\folder\*.txt"  /remove:g "domain\username" /C

:::: Grants explicit READ & EXECUTE ACL access ONLY to *.txt files beneath directory listed to ONLY account specified
ICACLS "T:\folder\*.txt" /grant:r "domain\username:(RX)" /C

Further Resources

  • Yes, please note I need to do this on a folder, not a file Oct 25, 2015 at 23:53
  • Hi, thanks for the extra commands. Tried ATTRIB -R /D /S "<Foldername>" and got "Not resetting system file - foldername" Oct 26, 2015 at 0:11
  • sorry, no idea how to use ICACLS Oct 26, 2015 at 0:16
  • Thanks, adding NETWORK SERVICE to the folder seemed to stop the error in the event viewer. Oct 26, 2015 at 0:31

Although the Microsoft KB article is for previous versions of Windows, the same probably applies in your case. Folders in Windows do not really have a "read-only" attribute, and it is not the cause of your app's failure.


You must log in to answer this question.

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