How To Resolve the Error When a Folder or File Is Open in Another Program
Dealing with that annoying “The action can’t be completed because the folder or a file in it is open in another program” message? Yeah, it happens more often than you’d think. Basically, Windows is telling you a file or folder is in use somewhere else—maybe another app, background process, or even a lingering explorer window. The problem is, sometimes Windows makes it hard to find what’s actually locking that file. This guide walks through some tried-and-true ways to wrestle that error down, especially useful if you’re trying to delete, rename, or move stuff and keep hitting that wall. Usually, it’s just a process or a temporary lock that needs killing or resetting. Once fixed, you should be able to get on with your task without that frustrating popup popping up every five seconds.
How to Fix ‘The Action Can’t Be Completed’ in Windows
Method 1: Use Task Manager to End Locking Processes
This one’s the classic move. Windows sometimes keeps a process locked onto files even after you close the app. The culprit is often Windows Explorer itself. Killing or restarting Explorer can free up the file. It’s worth trying this first because it’s quick and doesn’t involve digging through logs or command lines.
- Press Ctrl + Shift + Esc to open the Task Manager directly. If that doesn’t work, right-click on the taskbar and choose Task Manager.
- Look for Windows Explorer in the list. It might be under “Apps” or “Background Processes” depending on Windows version — you might need to scroll down.
- Select Windows Explorer, then hit Restart at the bottom right. This kills all open File Explorer windows and immediately restarts the process.
- Check if you can now delete or move that file. Sometimes, on some machines, this needs a reboot afterward, but it’s often enough.
Note: On some setups, restarting Explorer alone fixes the lock, but in others, the file is still stubborn. If that’s the case, move on to the next approach.
Method 2: Use Command Line to Force Unlock
Sometimes, a process isn’t obvious, and Windows makes it tricky to identify, so a more technical approach can help. You can use command-line tools like handle
, part of Microsoft’s Sysinternals suite, to find out which process is locking your file and shut it down.
- Download Sysinternals Handle. Extract it somewhere easy to find, like your desktop.
- Open Command Prompt as administrator. (Right-click Start, select Command Prompt (Admin) or Windows Terminal (Admin).)
- Navigate to the folder where
handle.exe
is stored. For example:cd C:\Users\YourName\Desktop\sysinternals
- Run the command:
handle.exe -u | findstr filename.ext
replacing filename.ext with your actual file name. - This shows you the process ID and process name locking the file. You can then close that process via Task Manager or command line (usually with
taskkill /PID [PID]
).
Warning though: killing processes blindly can be risky — make sure you know what you’re stopping. On some machines, this might require a reboot after all.
Method 3: Use a Third-Party Unlocker Tool
If command lines aren’t your thing or it feels too messy, try a dedicated unlocker like LockHunter or IObit Unlocker. These tools give you a visual way to see what process is holding onto the file and allow you to unlock or delete it without too much fuss.
Honestly, these are kind of messengers of last resort but sometimes fall faster than trying all the manual options. They can also handle stubborn files that just won’t budge otherwise.
Method 4: Boot into Safe Mode and Delete
If all else fails, the best thing to do might be restarting into Safe Mode. It loads Windows with minimal services and doesn’t typically lock files as aggressively. If the file is open or in use by a background process, going Safe Mode can make it vanish.
- Press Shift + Restart from the Start menu to get into advanced startup options.
- Navigate to: Troubleshoot → Advanced options → Startup Settings and click Restart.
- After restart, press 4 to select Safe Mode. Now, locate the file or folder and delete it — if possible.
- Restart normally afterward. It’s a bit awkward but works like a charm sometimes.
Heads up: Windows being Windows, sometimes even Safe Mode can’t unlock a file if it’s deeply integrated in some process, but it’s worth trying.
Extra Tips & Common Issues
Sometimes, the error sticks because of background tools like antivirus scanners or cloud sync apps (Google Drive, OneDrive) still holding onto files. Pause or exit those first before trying again. Also, rebooting after killing processes can clear loose handles.
And yeah, Windows has to make things harder than necessary. Don’t get frustrated — with patience, you usually break through.
Summary
- Close explorer or related processes via Task Manager
- Use Command Line or third-party tools to find and kill the locking process
- Try Safe Mode if nothing else works
- Check background apps or antivirus that might be locking files
Wrap-up
Figuring out what’s locking a file can be a pain, but these tricks usually do the job. Sometimes, the simplest fix — restarting or killing Explorer — is enough, other times you need a more brute-force approach with command-line tools or unlockers. Getting that file freed up means you can finally move on with whatever task was stuck. Just keep in mind, dealing with locked files is kinda hit-or-miss, but with patience, it’s doable. Fingers crossed this helps.