≡ Menu

Attrib not resetting hidden file

When we  use attrib command to change read-only or system attributes of a hidden file we get the error “Not resetting hidden file
See the examples below.

C:>attrib test.txt
A   H        C:test.txt
C:>attrib +R test.txt

Not resetting hidden file - C:test.txt
C:>attrib +S test.txt
Not resetting hidden file - C:test.txt C:>

The workaround in this case is to specify both the attributes like below.

E:>attrib test.txt
A   H        E:test.txt
E:>attrib +R test.txt
Not resetting hidden file - E:test.txt

E:>attrib +R +H test.txt
E:>attrib test.txt
A   HR       E:test.txt
E:>

Similarly we can set system attribute too.

If you are trying to remove readonly attribute from a hidden file you would get the same error i.e ‘Not resetting hidden file‘. You can apply the same workaround for this case too. The command we need to use in this case is given below.

attrib -R +H filename

Basically you need to specify what attributes you want the end file to have.

{ 5 comments… add one }
  • ChandreGowda March 7, 2012, 3:52 am

    I have a file which has all attribute set

    E:\>attrib autorun.inf
    A  SHR     E:\autorun.inf

    I wanted to unset all attribute, but not able to achieve it. Let me know how to unset all.

    E:\>attrib  autorun.inf -H -S -R
    Access denied - E:\autorun.inf
    
    E:\>attrib  autorun.inf -H -S -R -A
    Access denied - E:\autorun.inf
    
    E:\>attrib  autorun.inf -H -S
    Access denied - E:\autorun.inf
    • admin March 7, 2012, 2:47 pm

      I think you don’t have sufficient permissions to modify this file. Check the permissions of the file using this below command.

      cacls autorun.inf
  • david September 21, 2014, 2:42 pm

    Thank You Admin,

    I was not able to change attributes with attrib. I found your post and used cacls to change the permissions to full. I was then able to change the attributes with attrib and then delete the file. Even FileAssassin was not able to delete the file. This was a tough one.

  • Turfmonster May 23, 2015, 5:17 pm

    I believe that file is on a disc… You cannot delete it.

  • Hemant Sharma July 10, 2015, 10:45 am

    I hide some file in window 7 and now i changed my window with new window 7 this time it says access denied

Leave a Comment