Curious Minds

Clear answers to science and history questions

How to Force Delete a Folder Access Denied

· 6 min read · Science

When Windows refuses to delete a folder with an "Access Denied" error, it usually means your account lacks the necessary permissions, a file inside is locked by a running program, or the folder's ownership is set to another user or system account. Forcing deletion requires taking ownership, adjusting permissions, and sometimes using command-line tools or third-party utilities. Before you begin, back up any important files—force deletion is permanent and bypasses the Recycle Bin.

What You'll Need

  • Administrator rights on the computer.
  • Command Prompt or PowerShell (both included with Windows).
  • Optional: a third-party unlocker tool such as LockHunter or IObit Unlocker (use with caution; download only from official sites).
  • A backup of any files you might need later.

Step-by-Step

  1. Close all programs that might be using the folder. Files inside the folder could be open in an application, preventing deletion. Close File Explorer windows, document editors, media players, and any background sync tools (OneDrive, Dropbox). If unsure, restart your computer and try deleting again before proceeding.
  2. Take ownership of the folder. Right-click the folder, choose Properties, go to the Security tab, and click Advanced. Next to Owner, click Change. Type your username (or Administrators for the built-in admin group) and click Check Names, then OK. Check Replace owner on subcontainers and objects and click Apply.
  3. Grant full control permissions. Still in the Advanced Security Settings window, go to the Permissions tab and click Change permissions. Select your user account (or Administrators), click Edit, and tick Full control under Allow. Check Replace all child object permission entries with inheritable permission entries from this object and click OK. Apply changes to all subfolders and files when prompted.
  4. Try deleting the folder normally. After taking ownership and granting full control, right-click the folder and choose Delete (or press Shift+Delete to bypass the Recycle Bin). If it deletes, you're done. If the error persists, continue to the next step.
  5. Use the Command Prompt with takeown and icacls. Open Command Prompt as Administrator (search "cmd", right-click, Run as administrator). Type takeown /f "full path to folder" /r /d y and press Enter. This transfers ownership of the folder and all its contents to your account. Then type icacls "full path to folder" /grant administrators:F /t and press Enter. This grants full control to the Administrators group for the folder and everything inside. Finally, delete the folder with rmdir /s /q "full path to folder".
  6. Boot into Safe Mode if the folder is still locked. Some files are locked by system processes that start with Windows. Restart your PC and repeatedly press F8 (or use Settings > Update & Security > Recovery > Advanced startup to restart into Safe Mode). In Safe Mode, only essential drivers load, so locked files are often released. Repeat steps 2–5 while in Safe Mode.
  7. Use a third-party unlocker tool as a last resort. Tools like LockHunter or IObit Unlocker can identify which process is locking a file and force-delete it. Install from the official website, right-click the stubborn folder, and choose the unlocker option. Use these tools carefully—they can delete files that Windows needs, so only target the folder you intend to remove.

Common Mistakes

  • Skipping the backup. Force deletion is irreversible. Always copy important files elsewhere first.
  • Not running as administrator. Many permission changes require elevated rights. Always open Command Prompt or PowerShell with "Run as administrator".
  • Forgetting to replace permissions on subcontainers. If you only change permissions for the top folder, files inside may still block deletion. Always tick the option to apply changes recursively.
  • Using third-party tools without checking the source. Download unlockers only from reputable vendors; malicious versions can harm your system.
  • Ignoring the possibility of malware. If a folder keeps reappearing or resists deletion despite all steps, scan your system with antivirus software.

Tips

  • Use Shift+Delete to bypass the Recycle Bin and avoid leaving a copy behind.
  • If the folder path is long, copy it from the address bar in File Explorer to avoid typos in Command Prompt.
  • In PowerShell, you can use Remove-Item -Path "folder path" -Recurse -Force as an alternative to rmdir.
  • Check for hidden files or system files that might be inside the folder—these can prevent deletion even after ownership changes.
  • If the folder is on an external drive, ensure the drive is not write-protected and is properly connected.

Troubleshooting

If you still get "Access Denied" after following the steps, consider these possibilities:

  • The folder is in use by a system process. Use Resource Monitor (search "Resource Monitor" in Start) to check which process has a handle on the folder. Go to the CPU tab, expand Associated Handles, and search for the folder name. You can end the process if it's safe to do so.
  • Antivirus or ransomware protection is blocking deletion. Temporarily disable real-time protection (re-enable it afterward) and try again.
  • The folder is on a network drive or has inherited permissions from a parent folder that deny access. Check the parent folder's permissions and ensure your account has full control there as well.
  • Corrupted user profile or system files. Run sfc /scannow in an elevated Command Prompt to check for system file corruption.
  • Try a different administrator account. Sometimes the built-in Administrator account (usually disabled by default) can delete folders that other admin accounts cannot. Enable it via Computer Management > Local Users and Groups if necessary.

Frequently Asked Questions

Why does Windows say "Access Denied" when I try to delete a folder?

Windows denies deletion when your user account lacks the required permissions, when a file inside the folder is open in another program, or when the folder's ownership belongs to another user or a system account. It's a security feature to prevent accidental or unauthorized deletion.

Can I force delete a folder without taking ownership?

In most cases, no. Taking ownership is usually necessary because the access check happens before deletion. However, if the folder is simply locked by a running process, closing that process may allow deletion without ownership changes.

Is it safe to use third-party unlocker tools?

Reputable tools from well-known vendors are generally safe when used correctly, but they can bypass Windows safeguards. Only download from official websites, and avoid using them on system folders or files you don't recognize.

What if the folder is a system folder like Windows.old?

System folders require special handling. For Windows.old, use Disk Cleanup (cleanmgr) and select "Previous Windows installation(s)" rather than forcing deletion. For other system folders, avoid manual deletion—use built-in tools or seek guidance from Microsoft support.

Will force deletion remove the folder from the Recycle Bin too?

Yes. Force deletion methods like Shift+Delete or command-line rmdir bypass the Recycle Bin entirely, so the folder is permanently removed. There is no easy undo.

Can I recover a folder after force deletion?

Only with file recovery software, and success is not guaranteed. That's why backing up important data before forcing deletion is strongly recommended.

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions