The “File is open in another program” error is one of the most annoying issues you can run into on Windows 11. It usually appears when you try to delete, rename, or move a file — only for Windows to insist that some mysterious program is still using it. Most of the time, the file isn’t visibly open anywhere, which makes the situation even more frustrating.
The good news is that this problem is completely fixable. Whether the file is locked by File Explorer, a background app, a Windows service, or even a stuck process, we’ll walk you through all the working methods to unlock the file and get rid of the error.
Why Windows Shows the “File Is Open in Another Program” Error
This error typically happens when:
- A background app is using the file
- File Explorer has a preview or thumbnail lock on the file
- The file is used by Windows Indexing
- The file is syncing with OneDrive or Google Drive
- Antivirus software is scanning the file
- A hidden or crashed process is still locking it
- The file is marked “in-use” due to corruption
Now let’s apply the solutions.
1. Close All Apps That Might Be Using the File
Before moving to advanced fixes, start with the basics:
- Close apps like:
- Word
- Excel
- Photoshop
- VLC
- Notepad
- Browsers
- Try deleting or renaming the file again.
This often works if the file is actually still open without you realizing it.
2. Restart File Explorer (Quickest Fix)
File Explorer often locks files due to previews or thumbnail generation.
- Press Ctrl + Shift + Esc to open Task Manager.
- In the Processes tab, find Windows Explorer.
- Right-click → Restart.
Now try the file operation again.
3. Use Task Manager to Find and End the Program Locking the File
Task Manager can help you locate processes using the file.
- Open Task Manager.
- Click More details (if needed).
- Look for suspicious processes:
- Microsoft Office apps
- Media players
- Browsers
- Cloud sync apps
- Editors like Notepad++, VS Code
- Select the app → Click End task.
- Try accessing the file again.
4. Disable File Explorer Preview Pane (Prevents File Locks)
The preview pane sometimes locks files, especially images, PDFs, and videos.
- Open File Explorer.
- Click View in the ribbon.
- Turn Preview Pane off.
Now retry deleting or renaming the file.
5. Turn Off File Explorer Thumbnails
Thumbnails can lock large photos, videos, and PSD files.
- Press Windows + R, type
control folders, press Enter. - In the View tab:
- Check Always show icons, never thumbnails
- Click Apply → OK.
- Restart File Explorer.
6. Stop OneDrive or Google Drive Sync
Cloud services frequently lock files during syncing.
Stop OneDrive syncing:
- Right-click the OneDrive icon in the tray.
- Choose Pause syncing.
- Pick 2 hours.
Stop Google Drive:
- Click the Google Drive icon.
- Choose Pause syncing.
Try accessing the file again.
7. Restart Your PC (Simple but Often Works)
A quick restart resets all processes holding onto the file.
- Click Start.
- Choose Power → Restart.
After rebooting, try the file operation again.
8. Use Resource Monitor to Check Which Program Is Locking the File
If you want precision:
- Press Windows + R, type
resmon, press Enter. - Go to the CPU tab.
- Expand Associated Handles.
- Search the locked file’s name.
- Right-click the locking process → End process.
This is one of the most accurate ways to find the culprit.
9. Empty the Windows Temp Folder
Temporary files being locked can block adjacent files.
- Press Windows + R, type
%temp%, press Enter. - Select everything → Delete.
This clears stuck temporary processes.
10. Disable Indexing for the File or Folder
Windows Search Indexing can briefly lock files.
- Right-click the problematic folder.
- Click Properties.
- Select Advanced.
- Uncheck Allow files in this folder to have contents indexed.
- Click OK.
Wait a few seconds, then retry.
11. Boot into Safe Mode and Delete the File
Safe Mode loads minimal drivers and prevents background apps from locking files.
- Press Windows + I → System → Recovery.
- Under Advanced startup, click Restart now.
- Go to Troubleshoot → Advanced options → Startup Settings → Restart.
- Press 4 to enter Safe Mode.
Now delete or rename the file.
12. Delete the File Using Command Prompt
A stuck Windows process won’t block Command Prompt as easily.
- Press Windows + X → Windows Terminal (Admin).
- Use:
del /f /q "filepath"
Example:
del /f /q "C:\Users\Name\Desktop\lockedfile.mp4"
This forces deletion.
13. Use a Third-Party Unlocker Tool (Last Resort)
If nothing works, these tools can force-delete locked files:
- LockHunter
- IObit Unlocker
- Unlocker
These tools show which program is locking the file and help unlock and delete it safely.
Wrapping Up
The “File is open in another program” error can be incredibly frustrating, especially when you’re trying to clean up storage or organize your files. Thankfully, once you restart File Explorer, close background apps, pause cloud sync tools, or identify the locking process using Task Manager or Resource Monitor, the issue usually goes away quickly.