This article talks about "access denied" error which may appear in a variety of situations, and provides step-by-step solutions for each Access Denied scenarios. This error is explained in 5 cases, including most situations you may encounter. If you are experiencing same error message, keep reading to check solutions.
Overview on access denied error
Issue 1: You cannot open a file or folder
Issue 2: File / Folder access denied, error changing or deleting file or folder
Issue 3: Receive "Location is not available. Access is denied." error message
Issue 4: Error 5: Access Denied
Issue 5: DiskPart has encountered an error: Access is denied
Summary
If you are getting Access Denied error in Windows, then you are not alone. This is a quite common problem related to permission, file system, etc. It occurs when you are unable to open a file or folder, a service on your computer fails to start, cannot open file on a network, unable to access web site, etc. Error messages differ from issue to issue, for example, it can be "Folder Access Denied. You need permission to perform this action. You require permission from TrustedInstaller to make changes to this folder" or "Location is not available. E:\ is not accessible. Access is denied."
Let's see two real world cases on this error:
"I got problem in deleting a folder. Here is the story: I attempted to delete a folder using Shift + Del, but the Access Denied error occurred. The folder cannot be deleted and so did files in the folder. Also, I tried deleting as an Administrator, but it says I do not have that privileges. However, I'm the only user and it is the very administrator account. The error message is: <file path> is not accessible. Access is denied. I checked solutions online, and tried some, but none worked. Any suggestions?"
" couple of day ago I downloaded DOTA from STEAM I got an update error when I tried to launch the game. I looked to solutions and found one which asks to delete 'downloading' folder located in Steamapps. Unfortunately, I couldn't delete it, as it requires Administrator permission. I clicked Continue and got Access Denied error. I restarted PC and logged in as Administrator and still cannot delete it! Any idea to fix this?"
When you try to open a file or folder in Microsoft Windows, you are unable to access is and receive error message like:
"Folder is not accessible. Access is denied." (Folder here represents the name of the folder you cannot open.)
"You don't currently have permission to access this folder. Click Continue to permanently get access to this folder."
"You have been denied permission to access this folder. To gain access to this folder you will need to use the security tab."
An "Access Denied" error can occur for one or more of the following reasons:
Solution 1: Take ownership of the file or folder in Windows
Step 1 Select the file or folder you want to take ownership and right-click it to select Properties from context menu.
Step 2 Select the Security tab and click Advanced button. Then click Change. If you are asked to give confirmation or administrator password, then provide confirmation or type the password.
Step 3 Type the name of the person whom you want to give ownership to, and click Check Names.
Step 4 Click OK. If you want this person to be the owner of the folders and files that are stored in this folder, select check box of Replace owner on subcontainers and objects.
Step 5 Click OK.
Solution 2: Change permission
It is common that the access denied error you experience is related to permission. Permissions rules whether you can access or change files and folders. If you do not gain permission, you are not able to access specified location. If you are logging in as administrator and still cannot access a folder, you can try changing permissions. Note: to change permission you should log on as an administrator.
Step 1 Select the file or folder and right-click it to select Properties. Then click Security tab.
Step 2 Click your name under Group or user names, and you can see permissions you have.
Step 3 Select all boxes under Allow and click OK and Apply. Then you'll get full control of the file or folder, such as modify, read & execute, list folder contents, etc.
Solution 3: The file or folder is encrypted
Data encryption is one of the best solutions to protect data again any unwanted access. You are unable to access encrypt file or folder without proper certificate. You can have a check whether the folder is encrypted or not.
Step 1 Select and right-click the file or folder to click Properties.
Step 2 Select General tab, and then click Advanced button. If the Encrypt contents to secure data is selected, then file is encrypted, and you'll have to get the certificate to open it.
When you try to delete, copy, move or change a file or folder on your computer, you might be blocked by Accedd denied error which prompts you donot have permission to do so. The error message could be:
"Folder Access Denied. You need permission to perform this action. You require permission from TrustedInstaller to make changes to this folder."
"Destination Folder Access Denied. You need permission to perform this action."
This error might be caused by following reasons:
Solution 1: Take ownership using Command Prompt
There are a couple of methods to take ownership of a file or folder, and this solution modifies ownership in Command Prompt. It's OK if you follow steps in previous part to take ownership.
Step 1 Right-click on Start menu and select Command Prompt (Admin). If you are prompted for password or conformation, provide password or give confirmation.
Step 2 Confirm the path of the folder you want to take ownership. Here, say you want to take ownership of the folder Photos of E drive and the address is : E:\Photos
Step 3 Type command takeown /f "full path of the file or folder", which, in this case, should be takeown /f "E:\Photos". Then press Enter.
Step 4 Once the process completes, restart computer and check if the problem is removed.
Solution 2: Delete corrupt files with third-party software
Corrupted files cannot work properly and these files can be of any file type like pictures, documents, system files, etc. Many corrupted files cannot be repaired or even cannot be deleted. Here is an easier solution to delete corrupt files.
Step 1 Download, install and launch Eassos DiskGenius.
Step 2 Select the corrupt file or folder you want to delete, right-click it and select Delete Files Directly.
Step 3 Click Delete button to delete selected file. Note: files deleted in this way won't be put into Recycle Bin, please make sure these files are no longer important to you.
Tips on preventing files from getting corrupted:
Solution 3: Create a new local user account
If the access denied issue is caused by a corrupt account, you can resolve it by creating a new local user profile / account. To do that, follow these steps:
Step 1 Click Start menu and select Settings. Click Accounts on the Windows Settings pane.
Step 2 Select "Family & other people" on the left side and then click "Add someone else to this PC".
Step 3 Click link "I don't have this person's sign-in information" and click Next. On next screen, click "Add a user account without a Microsoft" account and click Next. Then you can enter user name, password and password hint, and then select Next.
When you are trying to open a partition on local hard drive or USB devices, you cannot open it and receive error message:
Location is not available. E:\ is not accessible. Access is denied.
Solution 1: Change permission for the drive
Step 1 In Windows Explorer, right-click the partition that you cannot access and click Properties. Continue clicking Security -> Advanced.
Step 2 Click Add in Advanced Security Settings and on next screen click Select a principal.
Step 3 Enter the username to select and click OK. Then you should select follow information:
Step 4 Click OK and Apply to save changes.
Solution 2: Recover data from inaccessible drive and format it.
If changing permission does not help, you can recover data from the inaccessible drive and format the disk to repair the error. It's easy to retrieve data when location is not available and access is denied. Here is the guide to recover data from corrupt drive.
Step 1 Install and launch Eassos DiskGenius, then check if files in this partition can be displayed directly. If not, go to next step.
Step 2 Select the inaccessible drive and click File Recovery button from the toolbar. Make sure you are selecting the correct partition.
Step 3 Select Complete Recovery mode and click Start button. The full scan will start to search for files and folders in selected partition.
Step 4 Preview files. File found by Eassos DiskGenius will be displayed automatically during scanning, and you can preview listed files and folders to check whether they are correct or damaged.
Step 5 Recover data. Select files and folders you want to recover and right-click them to select "Copy to". Then you can set a location to save recovered data.
When you install application or game on your computer, you are prevented from accessing certain location or modifying files; also, you attempt to start certain service or software but fails. Error messages you may receive as follows:
"Windows could not start the sshd service on local computer. Error 5: Access is denied."
"Setup was unable to create the directory "full file path". Error 5: Access is denied."
"Unable to execute file in the temporary directory. Setup aborted. Error 5: Access is denied."
The main reason of this error is permission issue. If you do not have the Administrator privileges or the account you logged in is not administrator account, the access denied error is tend to appear.
Solution 1: Fix permission issue in temp folder
Step 1 Double click Computer icon to open Windows Explorer. Then type %appdata%\..\local in the address bar and press Enter.
Step 2 Select and right-click on Temp folder and click Properties. Click Security tab and click Advanced button.
Step 3 Make sure the option "Replace all child object permission with inheritable permissions from this object" is selected.
Step 4 Select entries that are not inherited from "C:\Users\[Username]\" folder and click Remove. Click Apply and OK.
Solution 2: Make your account administrator
Step 1 Press key combination Windows + R to open Run dialogue where you should type netplwiz and press Enter.
Step 2 Select the user account that you want to change it to administrator and click Properties.
Step 3 Click "Group Membership" tab and select Administrator, then click Apply and OK.
When you use DiskPart to clean a disk, you cannot complete the task and receive error message:
DISKPART> clean
DiskPart has encountered an error: Access is denied.
See the System Event Log for more information.
Solution 1: Run Command Prompt as Administrator
Step 1 Make sure you are logging on your computer as the Administrator account. If not, restart your PC and log on Administrator account.
Step 2 Click Start menu and enter cmd in search box.
Step 3 Right-click "cmd.exe" and choose Run as administrator. If you are prompted for password or confirmation, then enter password or give confirmation.
Solution 2: Remove write protection
Step 1 Click Windows + R to open Run. Type regedit in Run dialog and click OK to open Registry Editor.
Step 2 In Registry Editor browse path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
Step 3 Right click key WriteProtect and change the value to 0.
In this article we discuss Access Denied error in 5 scenarios and provide step-by-step solutions to each issue. We hope these solutions are useful to you. If they are proved to be useful, please share it to help more people. If you have any questions or better solutions, please feel free to share or contact us.
Copyright © 2010-2024 Eassos Ltd. All Rights Reserved.