Is Windows File Explorer claiming that the file you’re trying to delete is open in another program? When you can’t open, edit, or delete a file, it’s either still running in the background or didn’t close properly.
We’ll show you how you can force close, rename, move, or delete a file that is in use.
How to Overcome the “File in Use” Error
If you want to skip the manual solutions, scroll down to the section where we list tools that can help you unlock and delete a file in use.
1. Close the Program
Let’s start with the obvious. Did you just open the file and not close it? If the file is closed, but the program is still running, close the application, then try again.
2. Reboot your computer
While rebooting is inconvenient, it requires zero skills or fiddling with stuff like the Task Manager or third-party tools. Rebooting also clears your RAM and possibly fixes other nuisances in one go. So try this if you can’t be bothered to look into the cause.
If you have already tried rebooting, and it didn’t help, skip to the next option.
3. End the Application via the Task Manager
The reason rebooting your computer helps is that the system will start from scratch. This closes all processes currently running in the Task Manager. Instead of rebooting, you can also try to manually end the process or application that holds your file hostage. This is the most successful method to fix the “file is open in another program” error.
Click Ctrl + Shift + ESC to open the Task Manager. Alternatively, you can right-click the Taskbar or click Ctrl + Alt + Del anywhere in Windows and select Task Manager.
If you see the compact Windows 1o version, click More details and make sure you’re in the Processes tab. Now browse for the application that you used to open the “file in use.” For example, if you were viewing a document, look for Microsoft Word.
Once you find the process, select it and click End task in the bottom right. This will close all instances of the program.
4. Change File Explorer Process Settings
By default, File Explorer launches all its windows in a single process (explorer.exe). However, it could be that your settings force File Explorer to launch separate processes, which could cause a conflict between different processes.
Press the Windows key + E to open File Explorer. Go to View > Options > Change folder and search options.
In the Folder Options window, switch to the View tab and find the Launch folder windows in a separate process option. Make sure it’s not checked. Click Apply to save any changes.
If the option was unchecked in the first place, you could try if checking it to see if it solves your issue.
5. Disable the File Explorer Preview Pane
Previews in the File Explorer can cause conflicts, like the “file is open in another program” error.
Press the Windows key + E, switch to the View tab, and press Alt + P to close the preview pane. The screenshot below shows an open preview pane on the right.
After closing the preview pane, try the operation again and see whether the “file in use” error has disappeared.
6. Force Delete the File in Use via the Command Prompt
You can bypass the File Explorer and force delete the file using the Command Prompt.
First, we need to track down the file path directory in File Explorer. Press the Windows key + E to open File Explorer, locate the affected file, and copy the file path.
Now right-click the Windows Start button and select Command Prompt (Admin). To navigate to the file directory of your file in use, enter cd [directory path you copied] and hit Enter.
Before we can proceed to force delete the file in use, we have to temporarily kill the File Explorer process. This will cause your Taskbar, wallpaper, and open folders to disappear. But don’t worry, you can restart File Explorer again and get everything back.
To close File Explorer, press Ctrl + Shift + ESC, find Windows Explorer, right-click the process, and select End task.
Return to the Command Prompt. If you lost the window, press Alt + Tab to jump to it.
Enter this command to delete the file, replacing everything between the quotes with your actual file name:
del "File in Use.docx"
To restart the File Manager, open the Task Manager (Ctrl + Shift + ESC), click File > Run new task, enter explorer.exe, and click OK. This should restore your desktop to its usual appearance.
Unlock the File in Use With a Tool
Sometimes, the file in use remains locked, even though it shouldn’t be. If trying to delete it through the Command Prompt didn’t work or if that task is too daunting, use one of these tools.
Microsoft’s Process Explorer is a more powerful File Explorer. It doesn’t just list all running processes, it can also show you which process took your file hostage. Simply open the Process Explorer Search via Find > Find Handle or DLL (or press Ctrl + Shift + F), enter the file name, and wait for the list of processes accessing your file.
You can’t close the process from the search window, but you can use Process Explorer or Windows Task Manager to close the offending application.
Unlocker used to add itself to the Windows context menu, meaning you could right-click the file in use and unlock it via the context menu. However, you’ll now need to do a little more work in Windows 10 to get Unlocker working.
In Windows 10, launch Unlocker, browse for the file, select the file, and click OK. Unlocker will look and (if found) remove locking handles. Even if it does not find a handle, you can use Unlocker to Delete, Rename, or Move the file.
Should the file still be in use, you can let Unlocker perform the action upon your next reboot.
Unlike Unlocker, LockHunter will add itself to the Windows context menu. Once installed, just right-click the locked file and select What is locking this file.
This should bring up a window showing all processes using the file. You can now select to Unlock, Delete (at next system restart), or Unlock & Rename the file. In our case, we couldn’t unlock the file, but deleting it at the next system restart did work.
File Still in Use? Boot Into Safe Mode
We showed you a few ways to unlock a file open in another program or in use by the system. Hopefully, one of them worked. If none of the above methods worked, or if you’re not interested in installing software, there is one last thing you can try: boot into Windows Safe Mode.
The file you’re trying to delete may automatically be loaded by another application. Unlockers should still work if that’s the case, but if malware is involved or if you don’t want to deal with third-party tools, then Safe Mode is your next best bet.
In Windows 10, press the Windows key + I, navigate to Update & Security > Recovery. Then, under Advanced startup, select Restart now.
From the next screen, select Troubleshoot > Advanced Options > Startup Settings > Restart. When your computer reboots, you’ll see the Startup Settings screen, from where you can choose Safe Mode.
Once you’re in Safe Mode, navigate to the file in question and try your luck once more.
Working Your Way Around File Explorer
It’s really annoying when an unwanted file claims to be still in use, and doubly so when you have no idea what’s using it. Now you know how to free up a locked file or force your PC to delete it regardless.
If solving this problem was the last straw for you, did you know there are File Explorer alternatives that you can download? For instance, XYplorer is an excellent portable substitute for Microsoft’s own offering.
Image Credit: Jane0606/Shutterstock
Author: Tina Sieber
Source: Tina Sieber.” How to Delete a File in Use by Another Program in Windows 10″. Retrieved From https://www.makeuseof.com/tag/5-ways-delete-file-use-windows/
All Rights Of This Article Reserved To MakeUseOf