How to remove ReadOnly from files in Windows 7?

247

Type cmd in the Start Menu or in Run and to...

Remove read-only attribute from a file type:

ATTRIB -R "C:\YourFile.ext"

Remove read-only attributes from a folder type:

ATTRIB -R "C:\YourFolder" /D

Remove read-only attributes from a directory tree (and all the files within) type:

ATTRIB -R "C:\YourFolder" /S /D

Otherwise, it may be an ACL issue and being on Windows 7, you'll want to use ICACLS:

ICACLS "C:\YourFileOrFolder" /grant:r %USERNAME%:F

You might need to specify your computer's name:

ICACLS "C:\YourFileOrFolder" /grant:r %COMPUTERNAME%\%USERNAME%:F

And if you need recursion:

ICACLS "C:\YourFileOrFolder" /grant:r %COMPUTERNAME%\%USERNAME%:F /T
Share:
247

Related videos on Youtube

Budius
Author by

Budius

Updated on September 18, 2022

Comments

  • Budius
    Budius over 1 year

    On our Android app we're passing strings resources via build script using the resValue, something like this:

    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.2"
    
        defaultConfig {
           resValue "string", "foo", "foo_value"
           resValue "string", "bar", "bar_value"
           ... etc
    

    How to add translated version of those strings. To go on values-de, values-ch, values-sp, etc folders?

    • Eyal
      Eyal about 12 years
      What went wrong when you tried those things?
    • Admin
      Admin about 12 years
      file still remains read only... the read only tab is still checked
    • Moab
      Moab about 12 years
    • Blackbelt
      Blackbelt about 7 years
      maybe this one helps?
    • Budius
      Budius about 7 years
      @Blackbelt not really. We're trying to inject values via CI, so in reality the values are coming from a System.getenv(key) command. Maybe I'll check into just download a complete .xml and replace in the project.
  • DavidPostill
    DavidPostill over 9 years
    This is not an answer to the original question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.