File is open in another program? How to release a Windows file lock
Last updated: 10 November 2026
You have probably seen one of these messages:
- “The action can't be completed because the file is open in another program.”
- “The file is in use. Please close the file and try again.”
- “Another program is using this file. The process cannot access the file.”
The usual cause is not that you closed the wrong window. Windows still has an open file handle. Antivirus scanning, Explorer previews, the search indexer, cloud sync, archive tools, download managers, and even editors you thought were closed can keep a handle open in the background.
Why is the file still locked after closing the app?
- Explorer preview: thumbnails, the preview pane and the details pane can hold handles.
- Search indexing: Windows Search scans files while building its index.
- Cloud sync and antivirus: OneDrive, other sync clients and security tools scan or upload files in the background.
- Download and archive tools: browsers, download managers and archive utilities may keep a handle after finishing.
- Crashed or minimised apps: if the process did not exit, the handle is not released.
Four ways to fix it
1. Close the app that may be using the file
Close any editor, player, sync client or archive tool that may still hold the file, wait a few seconds, then retry. Do not start by ending critical Windows processes.
2. Restart Explorer
If explorer.exe owns the handle, open Task Manager, right-click “Windows Explorer” and choose “Restart”. The desktop and taskbar disappear briefly and then return.
3. Use Resource Monitor
Press Win + R, type resmon, open the CPU tab, expand “Associated Handles” and search for the file name. Confirm the process really belongs to the file before ending it.
4. Use NoOccupy to find and release the lock
After installing NoOccupy, right-click the locked file or folder and choose Release Lock. The app lists every process holding a handle, with its PID, executable path and detection source. Select the processes you want to end and confirm. Folders can be scanned recursively as well.
NoOccupy also has a CLI with JSON output for scripts. It does not run in the background and does not upload file names or process lists.
What if it still will not delete?
- Check whether the file is read-only or the current account lacks permission.
- Make sure the file is not on a network share, removable drive or sync folder.
- Temporarily pause antivirus or cloud sync and try again.
- If a critical system process owns the handle, restart the PC instead of forcing it.
Release file locks with NoOccupy
Windows 10/11 · free installer · US$4.99 one-time · up to 2 computers · offline activation
Common questions
Can ending a process lose data?
It can. Ending an app that is writing a file may discard unsaved work. Save your work first, and only end processes you have confirmed are holding the file.
Does NoOccupy need an internet connection?
No. Scanning and lock release stay on your PC, and the activation code is verified offline with a public key embedded in the app.
Can it scan a whole folder?
Yes. NoOccupy scans files inside a folder recursively and skips symbolic links and junctions to avoid loops.