Bottom Line: When Windows displays the error “The action cannot be completed because the file or folder is open in another program”, an active process or background system service holds an active file handle. You can force unlock and permanently delete the locked file using Resource Monitor, Command Prompt, or PowerShell.
Why Does Windows Lock Files?
Windows implements file locking mechanisms to prevent data corruption. If a program (such as Word, Photoshop, or a background updater) has a file open, Windows locks the file from being renamed, moved, or deleted until the process releases the handle.
3 Methods to Force Delete Locked Files in Windows
Method 1: Unlock via Resource Monitor (No Restart Required)
- Press
Win + R, typeresmon.exe, and press Enter. - Select the CPU tab.
- In the Associated Handles search bar, type the exact name of the locked file or folder.
- Resource Monitor will list the process holding the handle (e.g.
explorer.exe,chrome.exe,node.exe). - Right-click the process and select End Process.
- Delete your file normally in File Explorer.
Method 2: Force Delete via Command Prompt (Admin)
If Windows Explorer is holding the file lock:
- Press
Win + Xand select Terminal (Admin) or Command Prompt (Admin). - Terminate Windows Explorer temporarily to release file locks:
taskkill /F /IM explorer.exe
- Delete the locked file permanently (
/fforces deletion,/qenables quiet mode):
del /f /q /a "C:\path\to\locked-file.ext"
- Restart Windows Explorer:
start explorer.exe
Method 3: Force Delete via PowerShell Command
- Open PowerShell as Administrator.
- Run the
Remove-Itemcommand with the-Forceparameter:
Remove-Item -Path "C:\path\to\locked-folder" -Force -Recurse
Frequently Asked Questions (FAQ)
What if Windows says “Access is Denied” when trying to force delete?
If you receive “Access is Denied”, your user account lacks file ownership permissions. Right-click the file > Properties > Security > Advanced > Change Owner to your user account, then check Full Control.
Related Guides
- Learn about deleting %temp% files.
- Read our Windows 11 Master Storage Cleanup Guide.
Discussion
Loading authentication...