How Do I Unlock a File That Is Locked by Another Process on Windows?
Updated
Find the process that holds the file, then close that program or end the process before you try to delete, rename, or move the file. If you cannot identify or safely stop the process, use a file unlocker such as LockHunter to see the locking process and unlock or delete the file. As a last resort, schedule the deletion for the next Windows restart. This applies to Windows 11/10/8.1/7; LockHunter itself is described as a free 32/64-bit tool on its site, and it deletes files into the Recycle Bin so you can restore them if you delete by mistake.
Step 1: Confirm the file is actually locked
A locked file usually shows one of these symptoms:
- “The action can't be completed because the file is open in another program.”
- “You need permission to perform this action.”
- The file cannot be renamed or moved even though no visible program is using it.
Before changing anything, note the exact file path and whether the file is on a local drive, a USB/SATA drive, or a network location. LockHunter's page specifically presents itself as a tool for files blocked by processes you do not know, and it supports both 32-bit and 64-bit Windows.
Step 2: Identify the locking process
Option A: Use Windows Resource Monitor
- Open Resource Monitor (for example, by searching for “Resource Monitor” in the Start menu).
- Go to the CPU tab and expand Associated Handles.
- Type the file name in the Search Handles box.
- The listed process names are the ones holding a handle to that file.
Expected result: you see one or more process names. If the list is empty, the lock may be a permission issue, a pending delete, or a file on a removable drive rather than a normal process handle.
Option B: Use LockHunter
LockHunter's documented features include showing the processes locking a file or folder and giving detailed information on the process. It also integrates into the Explorer menu, so you can right-click a file and open it in LockHunter instead of searching manually.
Expected result: LockHunter lists the locking process or processes, which you can then act on.
Step 3: Choose the least destructive action
Use this order of operations so you do not lose data or destabilize Windows:
| Situation | Preferred action | Why |
|---|---|---|
| A normal app (editor, viewer, sync client) holds the file | Close the app, then retry delete/rename | Safest; no process is forcibly terminated |
| A background or unknown process holds the file | End the process, then retry | Stops the lock at its source |
| You are unsure what the process does | Unlock the file with the tool, or schedule deletion at restart | Avoids killing a system-critical process |
| The file may be malicious or is repeatedly re-locked | Delete with the unlocker, then check for malware | LockHunter's page names fighting malware as a use case |
| You might need the file later | Delete to Recycle Bin rather than permanent delete | LockHunter deletes into the Recycle Bin so files can be restored |
LockHunter's listed capabilities include unlocking, deleting, copying, or renaming a locked file; killing the locking process; removing locking processes from the hard drive; and unloading DLLs from processes. Use the smallest action that solves your problem: unlock or rename first, delete only when you are sure.
Step 4: Delete or rename the file
- If you closed the app or ended the process, try the normal delete or rename again.
- If the file is still locked, use the unlocker's unlock or delete command.
- If the file is in use by a process that restarts automatically, use the option to delete the file at the next OS restart.
- Empty the Recycle Bin only after you confirm you no longer need the file.
Expected result: the file is removed or renamed, and the operation does not return the “open in another program” error.
Why unlocking can still fail
- Insufficient permissions: the file may be owned by another account or protected by system permissions. Unlocking a handle does not grant permission.
- Read-only attribute: clear the read-only flag before deleting or editing.
- The process restarts: security software, sync clients, and updaters can relaunch and re-lock the file. Stop or reconfigure the program, or use delete-at-restart.
- The path is in use: a folder can be locked because a file inside it is open. Close the child file first.
- Removable or external drives: a drive-level lock or pending write can prevent deletion. Safely remove or reconnect the drive and retry.
- The file is malicious: if it keeps returning, scan the system rather than only deleting the file.
When to use a file unlocker versus manual methods
Use Resource Monitor and normal app-closing first when you can see the program and stopping it is safe. Use a file unlocker when the locking process is unknown, when Explorer gives no useful detail, or when you need to unlock, rename, or schedule deletion in one step. LockHunter is one such tool and is described on its site as free for 32- and 64-bit Windows; the page lists version 3.4.3 and a 3.2 MB download, and states support for Windows 11/10/8.1/7. The same site also offers a separate tool, USB Safely Remove, for USB/SATA drive issues, which is relevant if the locked file sits on an external drive.