How to fix access denied, file can be used or sharing violation error in Windows

Ever try delete a file and get access is Denied error? Or maybe you’re trying to copy or move a file or folder and you get a message saying source files can be used? This type of error can occur for a number of reasons: you do not have ownership of the file or folder and therefore cannot perform any action on it, or the operating system or other program that is currently using it. .

You can often tell what situation you’re in by seeing exactly what you’re trying to do. If you get Access is denied or You currently do not have permission to access this folder notice, then you’re probably looking at a permissions issue. If you’re not an Administrator on the computer, you probably won’t be able to fix this problem, so first make sure you can have access to an administrator account.

Access denied error

permission 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, encryption on the file, or if the file is in use. We’ll talk about file usage errors in the next section.

To get access to a file or folder, you need to configure the correct permissions for your account. Before you start doing any work, you should try clicking Continue button will show up automatically in Windows 7 and Windows 8. This will try to give your user account permissions to the folder as long as you are the owner.

directory access denied

If you get You have been denied access to this folder after clicking Continue it means you are not the owner and you will have to take ownership of the folder first before you can change any permissions.

Take ownership of files and folders in Windows

Unfortunately, acquiring ownership is a rather lengthy process, so it’s best to have plenty of time and patience before doing this. To get started, you need to right click on a file or folder, select Characteristic and then go to Guard navigation.

change permissions

If you don’t have access to the folder, you’ll see a message saying you must be an Administrator to view the security properties. Go ahead and click Continue. This will pop up another dialog where you have the option to change the owner.

advanced security settings

inside Change owner to , select your User or Administrator account. I personally choose my own account because that’s the default behavior in Windows when you create a new folder/file. Also, make sure to check Replace owners on tools and sub-objects box. Click OK and you’ll get another message saying you don’t have permission to read the content, do you want to replace the permission and grant yourself Full Rights. Click Right.

replace rights

Now make sure to click OK on any remaining open windows to close all dialogs. Do not attempt to change any other settings at this time. You must first close any open dialogs and return to the Explorer screen. Once there, right click on the file/folder again and select Properties and go to the Security tab. Now it will look a little different.

security tab explorer

You can access the contents of the file/folder at this point, but it’s best to reset the permissions completely. At this point, you just add yourself and that’s it. If you want the default Windows permissions to apply, you can follow the next few steps. Click Advanced and then click Change permissions.

Permissions change dialog

Click the Remove button and remove all currently listed permissions. At this point, it should just be your user account. When the listbox is empty, go ahead and check Include inheritance from this object’s parent box. Then click Application not the OK button.

right item

You’ll see several items appear in the list box, including one for your user account. Default permissions usually include SYSTEM and Administrator, so you should reset them properly this way. If the folder has many subfolders containing files, you can check Replace all child object permissions with those that can be inherited from this object box. Close all dialogs and you are good to go!

As I mentioned earlier, Access Denied in some cases can be caused by other problems. Corrupt user profiles are one of the weirder problems I’ve seen more of in domain environments. You can create a new user profile and then try to access the file or folder.

The other problem is if the file is encrypted. You can always try to check if the file is encrypted by right clicking and selecting Properties. Then click Advanced word button Shared and uncheck Encrypt content to secure data box.

encrypted folder

If someone encrypted the file/folder, you won’t be able to access it until you can decrypt it with their user account. Last problem if the file itself is corrupted. In that case, you will have to look for software that can help repair damaged files, although this is a very rare cause of problems.

File In Use or Sharing Infringement

Note that receiving an Access Denied message can be caused by a sharing violation, so if the above method doesn’t work, try the following procedure below.

You can download and install a free program called Process Explorer from Microsoft. You can use it to find out what processes are locking the file. Right click on the executable file after extracting and select Run as Administrator to run the program. Then don’t worry about all the crazy colors and bars, just go to the top and click Find And after that Find Handle or DLL.

find handle

Now type the name of the file in question in the box and type search. You do not need to enter the full name of the file; only part of it will also work most of the time.

search file processing

You will get back a list of processes that currently have locks on the file. In my case Notepad.exe locked my test document. Now select the item in the box and then close the search box. You will return to the main process discovery screen. At the bottom, a row will be highlighted and it should be the path to the file you selected in the search box.

close handle

Right click on that row and select Close handle. If there is more than one process in the search box, you will have to repeat the same process for each process. At this point, you can delete or modify the file as you wish. The program is useful when you receive these types of error messages:

  • File could not be deleted: Error 5 Access is denied
  • A sharing violation has occurred
  • The source or destination file may be in use
  • The file is being used 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 light 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. Like I said above, if someone manually denies you access, you won’t be able to access that folder or file unless you get permission from Administrator! Have any questions, post a comment. Interesting!

Leave a Reply

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