Have you ever tried to delete a file and get an Access Denied error message? Or maybe you are trying to copy or move a file or folder and you get a message that the original file can be used? This type of error can occur for several reasons: you are not the owner of the file or folder and therefore cannot perform any action on it, the operating system, or other program that is currently using it.
You can usually figure out which situation you are involved in by looking at exactly what you are trying to do. If you receive the message Access Denied or You do not currently have permission to access this folder , then you are probably facing a permissions issue. If you’re not the administrator of your computer, you probably won’t be able to fix this problem, so make sure you have access to the administrator account first.
Error access is denied
This particular error is usually caused by NTFS permissions, but it can also be caused by other issues such as a corrupted user profile, file encryption, or file usage. We’ll talk about errors in using files in the next section.
To access a file or folder, you must have the correct permissions configured for your account. Before you get started, try clicking the Continue button that will automatically appear in Windows 7 and Windows 8. This will try to give your account permission to access the folder as long as you own it.
If, after clicking Continue, you receive the message â€œYou are denied access to this folder,â€ it means that you are not the owner of the folder and you must first take ownership of the folder before you can change any permissions.
Take ownership of files and folders on Windows
Take ownership of files and folders in Windows
Unfortunately, taking responsibility is a tricky process, so it’s best to have enough time and patience before you try. First, you need to right-click a file or folder, select Properties and go to the Security tab.
If you do not have access to the folder, you will see a message stating that you must be an administrator to view the security properties. Go ahead and click Continue. Another dialog will appear where you can change the owner.
In the Change owner to box, select your user or administrator account. I personally choose my account because this is the default behavior on Windows when you create a new folder / file. Also don’t forget to check the Replace owner of subcontainers and objects checkbox. Click OK and you will get another message that you do not have permission to read the content, if you want to replace the permissions and give yourself Full Control. Click Yes.
Now don’t forget to click OK on any remaining open windows to close all dialogs. At this point, do not try to change any other settings. You need to first close all open dialogs and return to the explorer screen. Once there, right click on the file / folder again, select Properties and go to the Security tab. It should now look a little different.
At this point, you can access the contents of the file / folder, but it’s better to reset the permissions completely. At this point, you’ve just added yourself and that’s it. If you want the default Windows permissions to be applied, you can follow the next few steps. Click the Advanced button and then Change Permissions.
Click the “Remove” button and remove all of the listed permissions. For now, it should just be your user account. After the list is empty, select the Include inheritable permissions from the parent of this object check box. Then click the Apply button, not the OK button.
You should see multiple entries in the list, including one for your account. The default permissions also usually include SYSTEM and Administrators, so it’s a good idea to properly reset them this way. If there are many file subfolders in the folder, you can select the Replace all child object permissions with permissions inherited from this object check box. Close all dialogs and you’re done!
As I mentioned earlier, in some cases, access denied can be caused by other problems. A corrupted user profile is one of those weird issues that I encountered more often in domain environments. You can create a new user profile and then try to access the file or folder.
Another problem is that the file is encrypted. You can always try to check if the file is encrypted or not by right-clicking and choosing Properties. Then click the Advanced button on the General tab and uncheck Encrypt content to protect data.
If someone else encrypted the file / folder, you won’t be able to access it until you can decrypt it using their account. The last problem is if the file itself is damaged. In this case, you will have to look for software that can help restore corrupted files, although this is a very rare cause of the problem.
File in use or sharing violation error
Please note that receiving an Access Denied message may be caused by a sharing violation, so if the above method does not work, try the following procedure.
You can download and install Microsoft’s free Process Explorer You can use it to find out which processes are blocking a file. After unpacking, right click on the executable file and select “Run as administrator” to launch the program. Then don’t worry about crazy colors and stripes, just go to the top and click Find and then Find Handle or DLL.
Now enter the name of the file you want in the field and enter search. You do not need to enter the full file name; only part of this will work most of the time.
You should get a list of the processes that currently have locked the file. In my case, Notepad.exe blocked my test document. Now select an item in the box and close the search box. You should be back to the main Process Explorer screen. A line should be highlighted at the bottom, and this should be the path to the file you selected in the search box.
Right-click this line and select Close Handle. If there were multiple processes in the search box, you will have to repeat the same procedure for each process. At this point, you can delete or modify the file as you see fit. The program is very useful when you receive the following types of error messages:
- Unable to delete file: error 5 Access Denied
- A sharing violation has occurred
- Original or the target file can be used.
- The file is in use by another program or user.
- Make sure the disk is not full or write protected and that the file is not currently in use
The program is very lightweight and does not take up a lot of resources. It can also tell you a lot of other information about Windows processes, but that’s another article. As I said above, if someone has denied you access manually, you will not be able to enter that folder or file unless you are granted administrator permissions! Have questions, leave a comment. Enjoy!