“Access Denied” When Running Attrib

Today I was helping a user that couldn’t read or write to files in a folder on the network. I figured something was set on the files that had them set to Read Only. So I ran the following DOS command on the folder containing the files:

attrib *.*  -r +a -s -h /s

Some of the files were changed fine, but others threw an access denied error message. At first I thought it was permissions on the files. I discovered that we had full control permissions on the file.

I then restarted the computer in Safe Mode, thinking that the some type of software had the files locked. I still couldn’t do anything with the files in this folder. I couldn’t even move them from the folder to another.

Finally I decided something was wrong with the file system or disk. I ran CHKDSK /F from a DOS command prompt on the hard drive.

Finally, after the scan was finished I tried running the ATTRIB command again. Success! Finally I could read and write to the files again.


  1. Ana says

    I tried everything mentioned so far, and the files are still read-only. I ran a chkdsk, I changed the ownership. I edited permissions. Every time I reopen properties, the read-only box is checked again.

    If this helps at all, I’m trying to edit a game file in Program Files (x86)

  2. sldghmr says

    I had a similar issue. Files previously stored in a fileshare. Fileshare was replaced on a new drive. Files would not transfer with access denied errors. Any combination of ATTRIB command would fail with same error as here.

    Opened up properties > Security > Advanced > Owner (tab) then took ownership of the parent directory and checked the option to pass this to all subdirectories and files. That solved my problem.

  3. Tarang says

    Hi, i have given my external hdd to my friend as he needed it to back up her file. On getting back i plugged it on my laptop i couldnt find my contents though properties were showing that hdd contains data. I managed to get data by searching by its name. I had my SAP software installed so i can i make all the data in hdd visible. Please help me out with it. Thanks in advance

  4. peter brady says

    in properties\security\advanced\edit\everyone have a deny on list folder/list data, erase it by remove the deny on everyone

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>