Attrib not resetting hidden file

by admin on August 28, 2010

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.

{ 3 comments… read them below or add one }

ChandreGowda March 7, 2012 at 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

Reply

admin March 7, 2012 at 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 at 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.

Reply

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: