Few errors on Windows are as infuriating as this ubiquitous modal dialog:
The worst part? Windows often doesn't even tell you which program has it open! Even after closing all your visible applications, hidden background processes like Explorer, antivirus scanners, or orphaned text editors keep their claws buried in the file.
Why Does Windows Lock Files?
The Windows NTFS kernel enforces file handle locking to avoid data corruption. When a program opens a document or executable, it creates a handle via the Win32 CreateFile API. If it specifies exclusive access without sharing rights (FILE_SHARE_READ | FILE_SHARE_WRITE), the operating system rejects any request to rename, move, or delete that file with error code 0x80070020 (ERROR_SHARING_VIOLATION).
Method 1: The Native Windows Resource Monitor Fix
You don't always need third-party tools to locate which program has your file hostage. Windows includes a built-in diagnostic tool called Resource Monitor:
Step 1: Launch Resource Monitor
Press Win + R, type resmon.exe, and press Enter.
Step 2: Search for the File Handle
Click on the CPU tab at the top. Under the Associated Handles section, type the exact name or extension of the locked file into the Search Handles field.
Step 3: End the Process Holding the Lock
Windows will display the process name and PID holding the handle. Right-click the process name and choose End Process. Once terminated, return to File Explorer and delete the file.
⚡ The Instant 1-Click Solution
Skip searching through hundreds of system handles in Resource Monitor. Pexoris FileUnlocker is an ultra-portable 70 KB tool that queries the Windows Restart Manager API directly, highlights the rogue process in red, and unlocks or deletes the file in 1-click.
Download Pexoris FileUnlocker Free (48 KB)Method 2: 1-Click Deletion with Pexoris FileUnlocker
- Download and run PexorisFileUnlocker.exe.
- Browse or drag-and-drop the locked file or folder into the app.
- The locking process, PID, and executable path appear immediately in red.
- Click ⚡ Unlock & Force Delete to instantly destroy the locked file!
Frequently Asked Questions
What if the locking process is Windows Explorer (explorer.exe)?
Explorer frequently locks folders when generating thumbnail previews. In Pexoris FileUnlocker, clicking "Restart Explorer" gracefully restarts the shell without losing open folder positions.
Can this damage my operating system?
Pexoris FileUnlocker includes safety guards that warn you if you attempt to unlock critical Windows protected system files (such as ntoskrnl.exe or System32\drivers). Normal user files and downloads can always be safely unlocked.