When This Error Shows Up
You're trying to delete a Word doc you finished editing. Or maybe a video file from a bad download. You right-click, hit Delete, and Windows throws up that blue box: "The action can't be completed because the file is open in another program." Close the program? You don't even see it running. This usually happens with files from Microsoft Office (Word, Excel), Photos (Windows Photos app), or torrents (uTorrent, qBittorrent). The file is still in memory, even if the app window is gone.
Why This Happens
Windows keeps a handle to the file — a little pointer — so the program can read or write to it. When the program crashes or doesn't close cleanly, that handle stays alive. Windows thinks the program is still using the file. So it blocks you from deleting, renaming, or moving it. The real fix is: find that handle and kill it.
Fix It in 4 Steps
You don't need third-party tools. Windows has two built-in tools that work perfectly. I'll show you both. Start with the easy one.
Step 1: Open Resource Monitor (the fast way)
- Press Ctrl + Shift + Esc to open Task Manager.
- Click the Performance tab. At the bottom, you'll see Open Resource Monitor. Click it.
- In Resource Monitor, go to the CPU tab. In the Associated Handles section, type the name of your file (like "report.docx") in the search box.
- You'll see a list of programs holding that file. Look for the one that says "Handle Count" next to it — that's the culprit.
- Right-click that process name and choose End Process. Confirm the warning.
That's it. The handle is released. Now go back and delete your file.
Step 2: If Resource Monitor Doesn't Show Anything
Sometimes the handle is hidden — happens with Windows services or system files. Try this instead:
- Press Win + R, type cmd, right-click Command Prompt, and choose Run as administrator.
- Type this command (replace "yourfile.txt" with your actual file path):
handle -a "C:\Users\YourName\Documents\yourfile.txt"
This uses the handle tool from Sysinternals (it's built into Windows 10/11). It will show every process with a handle to your file, including hidden ones like svchost.exe.
- Note the process ID (PID) from the output. Then type:
taskkill /PID 1234 /F
Replace 1234 with the actual PID. This force-kills the program.
Step 3: Another Sneaky Fix — Restart Explorer
If the file is in a folder you had open, Windows Explorer itself might be holding it. This is common with video files or images you previewed.
- Open Task Manager (Ctrl + Shift + Esc).
- Find Windows Explorer in the list. Right-click it and choose Restart.
- Your taskbar and desktop will flash for a second. Then try deleting the file again.
Step 4: Use LockHunter (if you're comfortable with a tiny free tool)
I don't usually recommend third-party software, but LockHunter is the exception. It's free, small, and doesn't install junk. Download it, right-click your file, choose What is locking this file? It shows exactly what's holding it and lets you release it with one click.
What to Check If It Still Fails
You've tried everything above. The file won't budge. Here's what's probably happening:
- You have a virus. Some malware locks files to prevent deletion. Run a full scan with Windows Defender or Malwarebytes.
- It's a system file. Windows protects certain files from being deleted — even by admins. You'll need to boot from a recovery drive or use a Linux live USB to remove it. That's advanced stuff.
- The file is in use by a background service. For example, SearchIndexer.exe indexes files and can hold them open. Stop the Windows Search service temporarily: open Services (services.msc), stop Windows Search, try deleting, then restart the service.
- You're on a network drive. If the file is on a shared folder, the server or another user might have it open. Ask your IT guy to close the session.
One last trick: reboot in Safe Mode. Boot into Safe Mode (press F8 during startup, or Shift+Restart from the login screen). In Safe Mode, only essential Windows services run. Try deleting the file there. 9 times out of 10, it works.
That's it. You don't need to waste time with "close all your programs" advice. You need to find the exact handle and kill it. Now go delete that file.