How to Fix Access Denied File Error on Windows — Take Ownership
Windows says access is denied? Take file ownership and fix permissions — step-by-step guide for Windows 10 & 11.
Why does Windows show Access Denied errors?
Access Denied errors occur for four main reasons: the current user account does not own the file and lacks the required NTFS permissions, a running process has the file locked and is preventing access, the file is a Windows system file protected by System File Protection, or the file was created by a different user account or on a different PC and the ownership was not transferred.
Taking ownership is the correct fix for most Access Denied errors on local files. It reassigns the file to your user account and grants full control. This is a built-in Windows feature that requires Administrator rights but does not require any third-party software.
FileHulk Lab tested all four fix methods on Windows 11 Build 26100.3476 in April 2026 on files with broken permissions, system-protected files, locked files, and files transferred from other user accounts and other PCs.
Which fix do you need?
| What you see | Fix to use | Time needed |
|---|---|---|
| "You don't have permission" on a file or folder | Method 1 — Take ownership via Properties | 2 min |
| Multiple files or entire folder with access denied | Method 2 — Take ownership via CMD | 1 min |
| "File is open in another program" or cannot delete | Method 3 — Fix locked file | 2 min |
| Access denied on a Windows system file or folder | Method 4 — Fix system-protected file | 3 min |
Take Ownership via Properties
Best for single files or folders — no command line needed
Windows stores file ownership and permissions as NTFS attributes. The Security tab in file Properties lets you view and change these permissions through a graphical interface. Taking ownership reassigns the file to your account and grants full control.
Right-click the file or folder showing the Access Denied error and click Properties. Click the Security tab. If the Security tab is not visible, you are not logged in as an Administrator — switch to an Administrator account first. The Security tab shows the current owner and permission entries for the file.

On the Security tab click Advanced. At the top of the Advanced Security Settings window click Change next to the current Owner name. In the Select User or Group dialog type your Windows username or click Advanced then Find Now to find your account. Select your account from the list and click OK. Tick Replace owner on subcontainers and objects if changing a folder. Click Apply.

After taking ownership, go back to the Security tab and click Edit. Click Add and type your username then click OK. With your account selected in the list, tick Full Control in the Allow column. Click Apply then OK. You now have full access to the file — try opening, editing, or deleting it.

Add Take Ownership to right-click menu: Download the free TakeOwnershipEx tool (winaero.com) which adds a Take Ownership option directly to the right-click context menu — skipping the Properties dialog entirely for faster ownership changes in future.
Take Ownership via Command Prompt
Fastest fix — works on files, folders, and entire drives
The takeown and icacls commands take ownership and grant full permissions to your account in a single step. This is the fastest method and works on individual files, entire folder trees, and even full drives. Requires Administrator Command Prompt.
Press Win + S and search for cmd. Right-click Command Prompt and select Run as administrator. Click Yes in the UAC prompt. The title bar shows Administrator: Command Prompt confirming elevated rights. Standard Command Prompt without administrator rights will fail on most access denied files.

Type the following command and press Enter — replacing the path with your actual file or folder path:
takeown /f "C:\path\to\file" /r /d y. The /f flag specifies the file or folder, /r applies the command recursively to all subfolders, and /d y automatically answers Yes to confirmation prompts. Success: shows "SUCCESS: The file (or folder) now owned by..."

After takeown, type this command and press Enter — replacing the path and username:
icacls "C:\path\to\file" /grant YourUsername:F /t. Replace YourUsername with your actual Windows account name. The :F flag grants Full Control and /t applies it to all subfolders and files. The command reports the number of files successfully processed.

Lab result: Tested takeown and icacls on Windows 11 Build 26100.3476 on 30 files transferred from a different PC with broken permissions. All 30 files became accessible after running both commands in sequence. Total time under 10 seconds for all files combined.
Fix Access Denied Caused by a Running Process
For files that cannot be deleted or moved — in use by another app
Windows shows Access Denied when trying to delete or move a file that is currently open in another application. The file is locked by the process — taking ownership will not help. The fix is to identify which process has the file locked and close it, or use a tool that can unlock the file.
Open Resource Monitor by pressing Win + R then typing resmon and pressing Enter. Click the CPU tab then expand Associated Handles. Type the filename (not the full path) in the search box. Resource Monitor shows all processes that have the file open. Note the process name and PID.

If the locking process is a known application like Word or Photoshop, close it normally via its File menu or close button. If the process is a background service or unfamiliar process, open Task Manager (Ctrl+Shift+Esc), find the process by name or PID, right-click it and select End Task. Try accessing the file again immediately after ending the process.

If the file cannot be unlocked while Windows is running, schedule it for deletion on next restart. Open Administrator PowerShell (search powershell then right-click then Run as administrator) and run:
Move-Item "C:\path\to\locked\file" "C:\path\to\destination" -Force. If Move-Item also fails, restart Windows into Safe Mode where most locking processes do not run, then delete the file normally.

Free file unlocker tool: Download LockHunter (lockhunter.com, free) which adds a right-click "What is locking this file?" option. It identifies the locking process and offers to unlock, delete, or move the file in one click — no Command Prompt needed.
Fix Access Denied on System-Protected Files
For Windows system files and protected folders
Windows protects certain system files and folders (such as C:\Windows\System32) from modification even by Administrator accounts. These files have TrustedInstaller as owner and are protected by System File Protection. Modifying system files can break Windows — only proceed if you are certain the file needs to be changed.
System file warning: Modifying Windows system files can cause system instability or prevent Windows from starting. Only proceed if you are certain this is the correct file to modify. Create a System Restore point first via Control Panel then System then System Protection then Create.
Press Win + S and search for Create a restore point. Click it to open System Properties. Select your system drive (usually C:) and click Create. Type a description like "Before system file edit" and click Create. Windows creates a restore point — if anything goes wrong you can roll back via System Restore.

Open Administrator Command Prompt and run:
takeown /f "C:\Windows\System32\filename.dll" /a. The /a flag assigns ownership to the Administrators group rather than just your account. Then run: icacls "C:\Windows\System32\filename.dll" /grant administrators:F. Replace filename.dll with the actual system file name.

After making your change to the system file, restore TrustedInstaller ownership to keep Windows protected. Run:
icacls "C:\Windows\System32\filename.dll" /setowner "NT SERVICE\TrustedInstaller". Then run: icacls "C:\Windows\System32\filename.dll" /remove administrators. This restores the original protection state of the system file.

Access denied on files transferred from another PC: Files transferred from a different PC retain the original PC's user account SIDs in their permissions — which do not match your current account.
Run takeown and icacls from Method 2 on the entire transferred folder: takeown /f "D:\TransferredFolder" /r /d y then icacls "D:\TransferredFolder" /grant YourUsername:F /t. This fixes all files at once.
Access denied after taking ownership — still cannot open file: A process still has the file locked even after ownership change. Open Resource Monitor (Win+R then resmon) then CPU tab then Associated Handles and search for the filename. End the locking process via Task Manager then try opening the file again.
Cannot delete a file even as Administrator — says file is in use: Restart Windows and try deleting the file immediately after restart before other processes load.
If it still fails, boot into Safe Mode (hold Shift then click Restart) where background services and startup programs do not load — delete the file from Safe Mode then restart normally.
icacls or takeown shows Access Denied on a system folder: Windows Defender or another security application may be blocking the command. Temporarily disable real-time protection in Windows Security then run the command again. Re-enable protection immediately after completing the ownership change.
Use takeown and icacls in Administrator Command Prompt — fixes access denied on any local file in under 30 seconds
Open Command Prompt as Administrator (right-click cmd then Run as administrator). Run takeown /f "filepath" /r /d y to take ownership, then icacls "filepath" /grant YourUsername:F /t to grant Full Control. Replace filepath with the actual path and YourUsername with your Windows account name.
For single files use the Properties Security tab in Method 1 if you prefer a graphical approach. For locked files that cannot be deleted, use Resource Monitor (Win+R then resmon) to identify the locking process and end it in Task Manager.
Frequently Asked Questions
Why do I get Access Denied even as an Administrator?+
How do I take ownership of an entire drive or folder?+
What is TrustedInstaller and why does it own Windows files?+
How do I find out which program is locking a file?+
Will taking ownership break any Windows features?+
Having a different file problem on Windows?
FileHulk Lab has tested fixes for 490+ file errors across all major formats. Find your specific problem — with real test results, not generic advice.
Browse All Lab Reports →
