Have you ever tried to delete, rename or move a file in Windows, only to see a message saying that the file is open in another program? You may have closed every visible application, but Windows still refuses to let you make the change.
This can happen because a background process is still using the file. It may be a cloud synchronisation service, antivirus software, a backup application, File Explorer or another program running without an open window.
Instead of randomly closing programs or restarting your computer, you can identify which process has the file open. Windows includes a built-in tool for this, and Microsoft’s Sysinternals utilities provide more detailed information when needed.
Why Windows says a file is being used by another process
When an application opens a file, Windows manages that access through file handles. Depending on how the application opened the file, it may prevent other programs from deleting, renaming or modifying it while it is in use.
The application does not need to be visible on your screen. Many programs continue running in the background after their main window is closed.
Some common examples include:
- Cloud synchronisation: OneDrive or another sync client may be uploading, downloading or checking a file.
- Antivirus software: Security software may be scanning a recently downloaded or modified file.
- Backup applications: A backup process may be reading files while creating a backup.
- File Explorer: Preview handlers, thumbnails or open folder windows may keep certain files in use.
- Media applications: A video editor, music player or image viewer may still have the file open.
- Background services: A service may be accessing application data without showing a normal desktop window.
The important thing is to identify the process before trying to force the file to close.
Find the process using Resource Monitor
Resource Monitor is included with Windows and can search for processes that have a particular file or folder open. You do not need to install another application for this method.
Follow these steps:
- Press Windows + R on your keyboard.
- Type
resmonand press Enter. - Open the CPU tab.
- Find and expand the Associated Handles section.
- Enter the file name or a distinctive part of its path in the search box.
- Wait for Windows to display matching results.
The results can show the process name, process ID (PID) and the matching file path. Check these details to identify which application is using the file.
For example, if the result shows OneDrive.exe, the OneDrive client may be accessing the file. If it shows explorer.exe, File Explorer may have an open handle associated with it.
Resource Monitor is a useful first step because it is already available in Windows. However, it may not provide all the details you need, particularly when the process runs with different permissions.
Use Process Explorer to identify the locked file
If Resource Monitor does not give you a clear result, Microsoft’s Process Explorer provides a more detailed way to inspect open file handles.
Process Explorer is part of the Microsoft Sysinternals tools. It can display which files and other objects processes have open, along with information about the processes themselves.
Download it from the official Microsoft Process Explorer page.
After downloading and opening the utility, follow these steps:
- Run Process Explorer. If necessary, use administrator privileges to inspect processes that are not visible with your normal permissions.
- Press Ctrl + F or open Find > Find Handle or DLL.
- Enter the file name, folder name or a distinctive part of the file path.
- Click Search.
- Review the matching process names and their details.
- Select a result to locate the process in the main Process Explorer window.
This is particularly useful when you do not know which background application is keeping a file open. You can also inspect the process to understand which application or service it belongs to.
Find locked files using the Handle command-line tool
If you prefer Command Prompt or need to investigate a file through the command line, Microsoft provides another Sysinternals utility called Handle.
Handle searches for open file references and reports the processes that have matching handles. It is useful when you want a quick result without navigating through a graphical interface.
First, download Handle from the official Microsoft Handle page. Extract the downloaded files and open Command Prompt as an administrator in the folder containing handle.exe.
Run this command:
handle.exe "filename"
Replace filename with the actual file name or a distinctive part of its path. For example:
handle.exe "report.pdf"
The output identifies matching processes and their process IDs. You can use the PID to locate the application in Task Manager or Process Explorer.
Handle requires administrative privileges. Also, remember that it searches for open references; finding a process with an open handle does not automatically prove that it is the reason Windows is refusing a particular operation.
What to do after identifying the process
Once you know which application is using the file, the safest option is usually to close that application normally. The correct action depends on what the process is doing.
For example, if OneDrive is synchronising the file, wait for the operation to finish. If an editor has the document open, save your work and close the document. If an antivirus scan is running, allow it to complete rather than interrupting the security process.
If the process appears stuck, you can check it in Task Manager:
- Press Ctrl + Shift + Esc to open Task Manager.
- Find the process using its name or PID.
- Check whether it belongs to an application you recognise.
- Save any work associated with that application.
- Close the application normally, or use End task only when you understand the consequences.
- Try deleting, moving or renaming the file again.
Do not end an unfamiliar Windows process just because it appears in the search results. It could belong to a system service or an application that is performing an important operation.
Why you should not force-close file handles
Some utilities allow you to close an individual file handle without closing the application. This may look like a convenient shortcut, but it can create problems.
An application may still expect that handle to remain open. Forcing it closed can interrupt a file operation, cause an application error or leave data in an unexpected state.
Microsoft specifically warns that closing handles through its Handle utility can cause application or system instability. The same caution applies when using advanced handle-management features in Process Explorer.
For normal troubleshooting, close the application or service cleanly instead of closing an individual handle manually. Only consider advanced handle operations when you understand the application and the possible consequences.
What if no process appears in the search results?
Sometimes the search returns no matching process even though Windows continues to report that the file is in use. This does not necessarily mean that the file is not locked.
Try these checks before taking more advanced steps:
- Search using a shorter name: Instead of entering the complete path, search for just the file name.
- Run the tool as administrator: Some processes may not be visible with normal permissions.
- Close open File Explorer windows: A preview pane or another open folder may be involved.
- Wait for background activity: Sync, backup and scanning operations may release the file after finishing.
- Restart Windows: If the file is still locked and you cannot identify the process, a normal restart may release temporary file handles.
If the problem continues after restarting, check whether a particular application or service opens the file again. A repeated lock may point to a background task that starts automatically.
Which tool should you use?
You do not need every utility for a simple file-locking problem. Choose the tool based on how much information you need.
| Tool | Best use | Requirement |
|---|---|---|
| Resource Monitor | Quickly find processes using a file | Built into Windows |
| Process Explorer | Detailed graphical inspection of open handles | Microsoft Sysinternals download |
| Handle | Search for open file references through commands | Microsoft Sysinternals download and administrator privileges |
| Task Manager | Close a recognised application or inspect its PID | Built into Windows |
For most users, Resource Monitor is a sensible starting point. Process Explorer is useful when you need more detail, while Handle is a good choice for command-line troubleshooting.
Also Read: Why Windows Shows Different File Sizes in Different Locations
Final thoughts
A file that refuses to move, rename or delete is not always damaged. A background application or Windows process may simply have it open.
Start with Resource Monitor to identify the process. If you need more information, use Process Explorer or Handle from Microsoft Sysinternals. Once you know which application is involved, close it safely and try the file operation again.
Avoid force-closing unfamiliar processes or individual file handles. Identifying the cause and releasing the file through the application itself is usually the safer approach.
About the Author
Himanshu writes about technology, software tools and practical digital solutions.








One comment on “How to Identify Files That Are Locked by Background Processes”