How to Delete a File in Use by Another Program in Windows 10
Sometimes, we may find that we want to delete a file in use by another program. If the other program is not responding, then it can be difficult to do so.
In Windows 10, when you want to delete a file that is open in another program, you should first close the other program and then try deleting the file again. Sometimes, this will work and sometimes it won't.
Here, in this article, we will look at the different ways to delete a file in use by another program in Windows 10.
1). Try Closing the Program
When you try to delete a file that is open in another program, Windows 10 will notify you that the action cannot be completed because the file is open in another program.
Windows 10 will offer to close the other program and then allow you to delete the file. You can also choose to cancel the operation and keep both files open.
If you have no intention of deleting the other file, it's better not to cancel and just save your changes before closing. But, if you want to delete the other file, you must try closing the program first.
2). Reboot your computer
It is not uncommon to be stuck in a situation where you can't reboot your computer because the file is open in another program.
When a reboot cannot be completed because the computer is open to another program with unsaved data, it needs to be closed. To close out of a program, go to the taskbar on the bottom of the screen and select the name of that specific program. This will close it and allow you to reboot.
3). Empty Recycling Bin
The Empty Recycling Bin is a feature in the Windows operating system that allows users to delete files from their computers. The user can empty the recycle bin by clicking on it with the mouse or by pressing the "Delete" key on the keyboard. This might help you if the action cannot be completed because the file is open in another program
4). End the Application via the Task Manager
When a user is accessing an application, they will be notified of the action that they are trying to complete. If they are trying to end the program, it will not go through and will instead prompt them with a message stating that the file is still open in another program.
In such a situation, you can end the application through the task manager by using the Ctrl+Shift+Esc keyboard shortcut. There are other ways to open the task manager, which you can find here.
5). Disable the File Explorer Preview Pane
With Windows 10, Microsoft has made it possible for users to disable the preview pane in File Explorer. This is done by editing the registry, which can be done from the command line or with a program like Registry Editor.
You can just press the Windows key + E, then move to the View tab, and press Alt + P to close the preview pane on Windows 10. In Windows 11, open File Explorer, and then move to View > Show, and click on the check mark next to Preview pane to close it.
6). Force Delete the File in Use through the Command Prompt
Force deleting the file in use on Windows 10 is not a difficult task. You can force delete the file in use by opening Command Prompt and typing the following command:
del /P "C:\Users\UserName\AppData\Local\Temp\file.txt"
This will force delete the text file that you are currently editing, but it won't work if you are using a program like Word, Excel or PowerPoint.
7). Boot Into Safe Mode
Safe Mode is a Windows operating system that can be used to fix certain problems on your computer. Safe Mode starts Windows with a basic set of drivers and programs so you can use your computer without worrying about other drivers or software.
Booting into safe mode is a way to troubleshoot your computer if you have a problem.
To boot into safe mode, you can follow 2 ways:
Method 1:
Using the Windows key + I, navigate to Update & Security > Recovery in Windows 10. Then, click Restart now under the Advanced starting section. In Windows 11, begin an advanced startup by opening the Settings app (Windows key + I), navigating to System > Recovery, and clicking Restart now.
Select Troubleshoot > Advanced Options > Startup Settings > Restart from the following screen. When your computer reboots, the Startup Settings page will appear, from which you can select Safe Mode.
Method 2:
1. Turn off your computer and then turn it back on again.
2. When the windows logo appears, press Shift + F8 to open the Advanced Boot Options menu.
3. Select Safe Mode from the list of options and press Enter on your keyboard or click on OK.
Conclusion
"The action cannot be completed because the file is open in another program." is a recurring error.
It appears when you try to delete a file that is being used by another program. This can happen if you are trying to delete a file while it’s open in another program, or if you are trying to rename a file that is open in another program.
If you follow the methods given above, you will be relieved of the error easily.