File Is Open in Another Program? Fix It in Windows
In this article
The fastest fix is to close the program that is actually holding the file, or restart Windows to release the lock. If you cannot find the program, use Task Manager to end the process, or use the built-in Resource Monitor to see exactly which process has the file open. The error usually appears when you try to delete, move, rename or overwrite a file that another application still has open in the background.
What You'll Need
- A Windows PC (Windows 10 or Windows 11; the steps are nearly identical, though labels can differ slightly by version and region).
- Administrator rights if you need to end a process owned by another user or a system service.
- Patience: the file may be locked by a program you forgot is running, such as a cloud sync client or an antivirus scanner.
Step-by-Step
- Close the obvious program. If you were just editing the file in Word, Excel, Photoshop, Notepad or a PDF reader, close that window completely. Do not just minimize it. If the program asks to save changes, save them first, then close.
- Check the notification area (system tray). Look at the bottom-right corner of the taskbar for icons of programs that run in the background: OneDrive, Dropbox, Google Drive, antivirus tools, backup utilities, or PDF printers. Right-click each one and choose Exit or Quit. Cloud sync clients are a very common cause because they open files to upload them.
- Try the file again. Attempt to delete, move or rename it. If the error is gone, you are done. If not, continue.
- Open Task Manager. Press Ctrl+Shift+Esc. In Windows 11, click the Processes tab if it is not already selected. In Windows 10, the Processes tab is the default view. Look for any app that might be using the file: word processors, media players, image editors, sync clients, or anything with the file name in its title bar.
- End the process. Right-click the suspected process and choose End task. If you are not sure which one it is, end the most likely candidate one at a time and test the file after each. Warning: ending a process can lose unsaved work in that program, so save anything important first.
- Use Resource Monitor for a precise answer. Press Win+R, type
resmonand press Enter. Click the CPU tab, then expand the Associated Handles section. Type the file name (or part of it) into the Search Handles box. The list will show the process or processes holding a handle to that file. Note the name under Image, then go back to Task Manager and end that process. - Restart Windows. If you cannot identify or end the process, a restart releases almost all file locks. Save your work in other programs first, then choose Start > Power > Restart. Do not use Shut down if Fast Startup is enabled, because that can preserve the lock; Restart is the reliable option.
- Check for a leftover Office or preview handler. Sometimes Word or Excel leaves a hidden process running after a crash. In Task Manager, look for WINWORD.EXE, EXCEL.EXE or POWERPNT.EXE on the Details tab and end them. Also close the File Explorer preview pane (View > Preview pane in Windows 11, or View > Preview pane in Windows 10) because it can lock files you merely selected.
- Try Safe Mode if the lock persists. If the file is still locked after a restart, boot into Safe Mode: open Settings > System > Recovery (Windows 11) or Settings > Update & Security > Recovery (Windows 10), choose Restart now under Advanced startup, then select Troubleshoot > Advanced options > Startup Settings > Restart, and press 4 or F4 for Safe Mode. In Safe Mode, only essential drivers and services load, so you can usually delete or move the file. Restart normally afterward.
Common Mistakes
- Only minimizing the program. A minimized window still holds the file open. Close it fully.
- Ignoring sync clients. OneDrive, Dropbox and similar tools often lock files while uploading or scanning them. Pause syncing or exit the client before retrying.
- Using Shut down instead of Restart. With Fast Startup enabled, Shut down can leave the previous session's locks in place. Restart is the cleaner reset.
- Ending the wrong process. Ending a system process or an antivirus service can destabilize Windows. Stick to user applications and check the process name carefully.
- Forcing deletion with third-party "unlocker" tools from unknown sources. Only use tools you trust; many free unlockers bundle unwanted software. The built-in Resource Monitor is safer and sufficient in most cases.
Tips
- Before deleting or moving a file, close its preview pane in File Explorer; the preview itself can hold a lock.
- If the file is on a network share or USB drive, another computer or user may have it open. Ask them to close it, or disconnect the drive safely and reconnect.
- Antivirus real-time scanning can briefly lock a newly downloaded file. Wait a few seconds and try again.
- When Resource Monitor shows a process you do not recognize, search the exact image name online before ending it, in case it is a Windows component.
- Keep Windows and your applications updated; file-locking bugs are sometimes fixed in updates.
Troubleshooting
If the file still will not budge, work through these in order:
- The process will not end. Right-click Task Manager's title bar, choose Run as administrator, and try again. Some processes require elevation to terminate.
- Resource Monitor shows a system process (such as System or svchost.exe). Do not end it. Restart the PC instead; a system handle usually clears on reboot.
- The file is on a removable drive. Close all programs, then use the Safely Remove Hardware icon in the notification area before unplugging. Reconnect and retry.
- The file is in a synced folder. Pause syncing in the cloud client's settings, perform the operation, then resume syncing.
- You still get the error in Safe Mode. The lock may come from another device on the network or from file permissions rather than an open program. Check the file's properties under the Security tab, and confirm no other PC has the shared folder open.
- Nothing works and the file is not important. You can rename the parent folder, which sometimes bypasses a stale handle, then delete the folder after a restart.
Frequently Asked Questions
Why does Windows say a file is open in another program when I closed everything?
Background processes such as cloud sync clients, antivirus scanners, indexers and preview handlers can hold a file open without any visible window. Resource Monitor shows the exact process.
Is it safe to end a process in Task Manager?
It is safe for ordinary user applications, but you may lose unsaved work in that program. Avoid ending processes named System, csrss.exe, winlogon.exe or anything you cannot identify.
Does restarting always fix the error?
It fixes the vast majority of cases because a restart releases file handles. If the lock returns immediately, a startup program or service is re-opening the file, so check your startup apps.
Can a file be locked by another computer?
Yes, if the file is on a shared network folder or a USB drive connected to another PC. Close it on that machine or disconnect the share.
Why can I open the file but not delete or rename it?
Some programs open files with read-only sharing, which allows reading but blocks deletion, renaming or overwriting. Close the program that has it open, or use Resource Monitor to find it.
Do I need a third-party unlocker tool?
Usually not. Task Manager, Resource Monitor and a restart cover almost every situation. If you do use a tool, download it only from the developer's official site.