1. Check if File is in Use
Are any of the files in use by a program or open on another computer that is connected? Ensure nothing has access to the file when trying to run attrib. If you can’t track down if the file is in use, you may want to try starting the computer in Safe Mode.
2. Check Permissions
1 Right-click the folder you’re working with then select “Properties“.
2 Select “Security“.
3 Select the “Edit…” button to edit permissions.
4 Select “Add…“.
5 Type your username to allow just your account access, or type “EVERYONE” to allow access to anybody. Select “OK” when you’re ready.
6 With the account you just added higlighted in the “Group or user names” area, select the “Allow” check for “Full control“. Select “OK” when you’re ready.
3. Check File System or Disk
It’s very common for attrib to throw “Access Denied” errors if there is problem with the hard drive. Try running CHKDSK /F on the drive from a DOS command prompt, then try to run attrib again when it’s finished scanning.