sodcalculator

10 Tech How-To

Fix Access Denied on a Windows Folder

Guide 10-54604 · Updated · Step by step

This guide walks you through the most common causes of the “Access Denied” error when opening a folder in Windows, and the exact steps to regain access. You’ll mostly use File Explorer properties and a command-line tool called takeown, which forces ownership back to your user account. No advanced skills are needed, but you must be logged in with an administrator account for most of these fixes.

What You’ll Need

  • An administrator account on the Windows PC (you can check by going to Settings > Accounts > Your Info).
  • The exact path to the folder that is giving you trouble (for example, C:\Users\OldUser\Documents).
  • Patience — some steps require a restart or a few minutes of waiting.

Step-by-Step

  1. Confirm the error is really “Access Denied.” Right-click the folder, choose Properties, then the Security tab. If you see “You must have Read permissions to view the properties of this object,” proceed with the command-line fix in Step 3. If you can see the Security tab, go to Step 2.
  2. Take ownership manually (when you can open Security tab). Click Advanced next to “To change permissions, click Edit.” In the new window, next to “Owner,” click Change. Type your Windows username, click Check Names, then OK. Tick the box “Replace owner on subcontainers and objects.” Click Apply, then OK. Now go back to the Security tab, click Edit, select your user, and tick Full control under Allow. Click Apply and OK.
  3. Use the command line to take ownership (when you cannot open the Security tab). Press Windows key, type cmd, right-click Command Prompt and choose Run as administrator. In the black window, type the following and press Enter after each line:
    takeown /f "C:\path\to\folder" /r /d y
    icacls "C:\path\to\folder" /grant "%USERNAME%":(OI)(CI)F /T
    Replace C:\path\to\folder with the actual folder path. The first command makes you the owner of the folder and everything inside it. The second gives your user account full control over all files and subfolders.
  4. Wait for the commands to finish. If the folder contains many files, this can take several minutes. Do not close the Command Prompt until you see “Successfully processed” messages or the prompt returns.
  5. Restart File Explorer. Press Ctrl+Shift+Esc to open Task Manager. Find “Windows Explorer” in the list, right-click it, and choose Restart. This refreshes the security tokens that Windows caches.
  6. Try opening the folder again. Double-click it. If it opens, you are done. If not, move to Troubleshooting below.

Common Mistakes

  • Typing the path wrong in the command line. A single missing backslash or a space in the wrong place will cause “The system cannot find the file specified.” Copy the path from the address bar in File Explorer, then paste it into the command.
  • Forgetting the /r flag on takeown. Without it, you only take ownership of the top folder, not the files inside. You will still get “Access Denied” when opening subfolders.
  • Only changing the owner, not the permissions. Ownership alone is not enough. You must also grant your user account explicit Full control permissions using icacls or the Security tab. Otherwise, you own the folder but still cannot open it.
  • Running Command Prompt without administrator rights. The takeown and icacls commands will fail with “Access is denied” if you are not elevated. Always right-click and choose “Run as administrator.”
  • Clicking “Continue” on the permission prompt and then ignoring the result. Sometimes Windows asks for permission, you click Continue, and it appears to work — but the folder still won’t open. Check the Security tab again; the permissions may not have been applied to subfolders.

Tips

  • Use the full path. If the folder is deep inside your user profile, type the full path in the command instead of navigating there. This avoids mistakes and works even if the folder is hidden.
  • Take ownership of the parent folder instead. If you are locked out of a folder that contains many subfolders, run takeown and icacls on the parent folder (for example, C:\Users\OldUser). This fixes everything inside in one pass.
  • Check if the folder is on a network drive or external drive. If it is, the problem might be on the other device. You may need to run these commands on the machine that hosts the folder, or check the sharing permissions on the network.
  • Make a backup of the folder path before you start. Write it down on paper. If you lose access to the folder, you may not be able to copy the path from the address bar.

Troubleshooting

Step 1: The command says “Access is denied” even though you ran as administrator. This usually means your account is not actually in the Administrators group, or User Account Control (UAC) is blocking the elevation. Go to Settings > Accounts > Family & other users, and check whether your account type says “Administrator.” If it says “Standard user,” you cannot run these commands. You will need to log in with a real administrator account, or ask the administrator to change your account type.

Step 2: The commands run but the folder still shows “Access Denied.” This often means the folder is not actually the one you think it is. Right-click the folder, go to Properties > Location. If it is a symbolic link or a junction (a shortcut that points elsewhere), the real folder is somewhere else. Run the commands on the target path shown there.

Step 3: You get “The system cannot find the file specified.” The path is wrong. Check for typos, missing backslashes, or spaces that need quotes. If the folder name contains a space, the entire path must be inside double quotes, like this: takeown /f "C:\My Folder\Sub Folder" /r /d y.

Step 4: The folder opens, but some files inside still give “Access Denied.” Run the icacls command again, but this time add the /C flag to continue even if some files fail, and the /L flag to handle symbolic links. The full command: icacls "C:\path\to\folder" /grant "%USERNAME%":(OI)(CI)F /T /C /L.

Step 5: The folder is encrypted with EFS (Encrypting File System). If the folder name appears green in File Explorer, it is encrypted. The takeown command will not help because the files are encrypted with a certificate that belongs to the original user. You cannot decrypt them without that user’s password or a backup of their encryption certificate. This is a hard limitation; no permission change will fix it.

Step 6: The folder is a system folder like C:\Windows or C:\Program Files. Forcing ownership of these can break Windows. Instead of taking ownership, try running the program that needs access as an administrator (right-click the program icon, choose “Run as administrator”). If you are trying to modify a system folder, you should not do so unless you know exactly what you are doing.

Frequently Asked Questions

Q: Will taking ownership of a folder damage my files?
A: No. Taking ownership only changes the security metadata (who owns the folder and what permissions they have). It does not modify, move, or delete any file content. Your data stays exactly as it was.

Q: Why did I get “Access Denied” in the first place if I am the only user?
A: The most common causes are: the folder was created by an older Windows installation or a different user profile, the folder was copied from another computer, or a program changed the permissions. Sometimes a Windows update resets permissions on certain folders.

Q: Can I use this method on a folder that is on an external USB drive?
A: Yes, the same commands work on external drives, as long as the drive is formatted with NTFS. If the drive is FAT32 or exFAT, those file systems do not support permissions, so you would not see “Access Denied” from Windows itself — the problem would be elsewhere.

Q: What is the difference between “take ownership” and “change permissions”?
A: Ownership is about who controls the folder — the owner can always change permissions. Permissions are the actual rules that say who can read, write, or execute. You need both: you must be the owner to change permissions, and you must have the correct permission (Full control) to open the folder.

Q: I do not have an administrator account. Can I still fix this?
A: No. Both the graphical method and the command-line method require administrator rights. You will need to ask the computer’s administrator to run the commands for you, or to change your account to an administrator temporarily.

Q: Is there a way to avoid this problem in the future?
A: Yes. When you create new folders, right-click them, go to Properties > Security > Edit, and make sure your user account has “Full control.” Also, avoid using the built-in “Administrator” account for daily work, and never move folders from another computer without checking their permissions first.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →