You try to save, move, delete, or rename a file and Windows throws back: “The action can’t be completed because the file is open in another program.” Frustrating? Absolutely. But it’s almost always fixable in under two minutes once you understand what’s actually happening.
This article covers every reliable method to resolve this error, why it happens in the first place, and how to stop it from coming back.
What Does “File Is Open in Another Program” Actually Mean?
When Windows shows this message, it means another process has a lock on the file. Windows uses file locking as a safety mechanism. When a program opens a file, it can request exclusive access so no other program can modify or delete it at the same time. This prevents data corruption.
The problem: programs don’t always release that lock cleanly. A browser might still hold a PDF you finished reading. An antivirus scanner may be mid-scan. A background process might be indexing the file. The result is that Windows blocks you from touching it.
The locked process is not always obvious. It often isn’t the program you think it is.
Quick Fix First: Close the Obvious Program
Before anything else, check the simple stuff:
- Close the document in Word, Excel, LibreOffice, or whatever editor you used.
- Close any browser tab that has the file open (especially PDFs or downloaded files).
- Close your email client if the file is an attachment you opened directly.
- Eject or close any media player holding a video or audio file.
Then try again. If it works, you’re done. If not, keep reading.

How to Find Which Program Is Locking the File
Using Resource Monitor (Built into Windows)
This is the fastest built-in method and works on Windows 10 and 11.
- Press Ctrl + Shift + Esc to open Task Manager.
- Click the Performance tab, then click Open Resource Monitor at the bottom.
- In Resource Monitor, go to the CPU tab.
- In the Associated Handles search box, type part of the filename and press Enter.
- Windows will show every process that has a handle on that file.
- Right-click the process and choose End Process if it’s safe to close.
Using Process Explorer (Free from Microsoft Sysinternals)
Process Explorer gives you more control and is more reliable than Task Manager for stubborn cases.
- Download Process Explorer from Microsoft Sysinternals.
- Run it as Administrator.
- Press Ctrl + F to open the Find Handle or DLL dialog.
- Type the filename and click Search.
- The results show exactly which process is holding the lock.
- Right-click the result and choose Close Handle to release it without killing the entire process, or right-click the process and choose Kill Process.
This is the cleanest method when you need surgical precision.
Fix the “File Is Open in Another Program” Error: All Methods
Method 1 – Restart Windows Explorer
Windows Explorer (explorer.exe) itself sometimes holds file locks, especially after you move or copy files.
- Press Ctrl + Shift + Esc to open Task Manager.
- Scroll down to find Windows Explorer.
- Right-click it and choose Restart.
Explorer will refresh and release any locks it was holding. This takes about five seconds.
Method 2 – Use the Command Prompt to Delete the File
If you just want to delete a locked file, the command line can help bypass the GUI restriction:
del /f "C:\path\to\yourfile.txt"
The /f flag forces deletion of read-only files. This works when the lock is soft. It won’t work on files locked by a running process.
Method 3 – Delete the File on Reboot
For files you can’t delete while Windows is running, you can schedule deletion at startup before other programs load:
- Open Command Prompt as Administrator.
- Type this command and press Enter:
MoveFileEx "C:\full\path\to\file.txt" "" /delay
Or use a free tool like Unlocker or FileAssassin which have a built-in “delete on reboot” option with a simple checkbox interface.
Method 4 – Disable Windows Search Indexer Temporarily
Windows Search constantly indexes files in the background. If it grabs your file mid-index, you’ll hit this error.
- Press Win + R, type
services.msc, press Enter. - Find Windows Search in the list.
- Right-click and choose Stop.
- Try your file operation again.
- Once done, right-click Windows Search and choose Start again.
Method 5 – Disable Antivirus Real-Time Protection Temporarily
Antivirus software scans files as they are accessed. If it has your file open mid-scan, it creates a temporary lock.
- Open your antivirus dashboard.
- Temporarily disable real-time protection (usually 10 or 15 minutes is enough).
- Try the file operation.
- Turn protection back on immediately after.
This is especially common with Defender, Avast, Norton, and Malwarebytes. If this fixes the issue consistently, look into adding a file exclusion for that folder in your antivirus settings.
Method 6 – Use Safe Mode
If nothing else works and you need to delete or move the file:
- Press Win + R, type
msconfig, press Enter. - Go to the Boot tab.
- Check Safe boot and select Minimal.
- Click OK and restart.
- In Safe Mode, almost no third-party programs run, so the file should be unlocked.
- Delete or move your file.
- Go back to msconfig and uncheck Safe boot to return to normal.
Common Scenarios and Their Specific Fixes
| Scenario | Most Likely Cause | Best Fix |
|---|---|---|
| Can’t delete a downloaded file | Browser still holds the handle | Close browser completely, then delete |
| Can’t save a Word/Excel file | Antivirus scanning on save | Temporarily disable AV real-time protection |
| Can’t delete a video file | Media Player or thumbnail generator | Restart Explorer.exe |
| Can’t move a folder | Windows Search indexing it | Stop Windows Search service temporarily |
| Error persists after closing all apps | Background system process | Use Process Explorer to identify and close handle |
| File in a shared network drive | Another user or system has it open | Check who has it open via Resource Monitor or contact network admin |
Why This Keeps Happening: Root Causes
Understanding the root cause helps you prevent it. The most common reasons files stay locked longer than they should:
Programs that don’t release handles properly. Some older or poorly coded software opens files and never explicitly closes the file handle until the whole program closes. This is a developer oversight.
Windows Thumbnail Cache generation. When you browse folders in Explorer, Windows generates thumbnails. The thumbnail service temporarily locks media files to read them. This is usually brief but can collide with deletion attempts.
Cloud sync clients. OneDrive, Dropbox, and Google Drive sync files in the background. If a file is being uploaded or synced, the sync client holds a lock. Wait for sync to complete, or pause syncing.
Antivirus on-access scanning. Every time a file is accessed, written, or moved, your antivirus may scan it. During that scan, it holds the file open.
Windows Search indexing. Especially on new files or recently modified ones, the indexer may jump in immediately.
Shadow copy / VSS service. If Volume Shadow Copy is running a backup snapshot, it may temporarily hold files.
How to Prevent This Error in the Future
- Wait a moment after closing programs before deleting files. Some apps take a second to fully release handles after closing.
- Pause cloud sync before large file operations. Right-click your OneDrive or Dropbox icon and pause syncing.
- Add exclusion folders to your antivirus for directories where you frequently work with temporary or scratch files.
- Keep software updated. Developers fix handle leak bugs in updates.
- Use a handle viewer like Process Explorer regularly if you do heavy file management work.
For deeper reading on how Windows handles file locking at the OS level, the Microsoft documentation on file locking explains the underlying mechanism clearly.
What About Mac and Linux?
On macOS, you’ll see a similar error phrased differently, like “The operation cannot be completed because the item is in use.” The fix is similar: use Activity Monitor, search for the file in the Open Files and Ports section, or use lsof | grep filename in Terminal to find the locking process.
On Linux, lsof +D /path/to/directory lists all open files in a directory. fuser filename shows you which PID owns the lock. Use kill PID to release it.
Conclusion
The “file is open in another program” error is Windows protecting file integrity, but it becomes a problem when programs don’t clean up after themselves. The fix is almost always: find what’s holding the lock, close or kill that process, and try again.
Start with the obvious (close the program you were using), move to Resource Monitor if that fails, and reach for Process Explorer when you need precision. For stubborn cases, scheduling deletion on reboot or using Safe Mode will get you there.
- How to Fix “File Is Open in Another Program” Error in Windows (2026 Guide) - February 19, 2026
- Speed Up Your Mac With These Top 10 Mac Troubleshooting Tips (2026 Guide) - February 19, 2026
- Fixed “Unknown USB Device (Device Descriptor Request Failed)”: 2026 Guide - February 19, 2026
