Sometimes when you want to delete a file or folder, Windows may return an error message saying that the operation is impossible or that the file is already in use by another program. There are a couple of tricks to overcome these recalcitrant “undeletable” files. In this article, we will see how to force delete a file on Windows 10.
“File not found”, “The file cannot be deleted”, “File is already in use by another program”… You may have already received this kind of strange error message. It’s the kind of situation that annoys and even drives you crazy. Without understanding why, as a result of a false manipulation or a bug, you end up with a file or a folder impossible to delete in Windows Explorer. Sometimes it is even impossible to move or rename it… Fortunately, there are some tricks to overcome these recalcitrant elements.
This is the kind of annoying situation that can make you waste an enormous amount of time trying to force the deletion of files without success and without understanding why. A false manipulation or bug can leave you with orphaned files that cannot be deleted from Windows Explorer. Sometimes you can’t even move the files or rename them. There are many ways to manually force file deletion natively with CMD, Windows Explorer, or with software designed to deal with this kind of situation.
Why You Can’t Delete Some Files ?
There are several reasons why you can’t delete a file in Windows 10:
- The file you try to already being used by an application (The most common reason).
- The file or folder is read-only.
- The storage media has a problem or its file system has errors.
- The PC is infected with a virus.
- The file or folder to be deleted was created by another Windows 10 user and you don’t have permissions to delete his files.
- You are trying to delete system files.
Depending on the case, different error messages may be displayed:
- Error when deleting the file or folder.
- Unable to delete the file: Access denied.
- File not found.
- Cannot delete a file. There has been a sharing violation
- The action cannot be performed because the file is opened in another program.
- Access Denied, Make sure the disk is not full or write-protected and that the file is not currently in use
Several solutions exist to force delete a file on Windows 10 and solve each of these problems. There is no guarantee that only one solution will work for every situation, you will sometimes have to try several methods to find the right one for your situation and error message.
How To Force Delete A File Using CMD
An effective method for deleting a file is to use the Windows command prompt. This tool is powerful and very effective for certain operations. And it often manages to force delete a file that are resistant to Windows.
Follow the steps below to force delete a file in Windows 10 with CMD
1. Click on Start and type “cmd”
Click on Start button or hit Windows key on your keyboard and type “CMD”
2. Right-click on “Command prompt” and click on “Run as administrator”
Right click on the “Command prompt” and run it as administrator.
3. Type the command “cd” followed by the path of the folder
Type the command “cd” followed by the path of the folder containing the file to be deleted, for example, “cd Desktop”.
4. Type del “your file” and press Enter to force file deletion.
Once in the folder containing the file you want to force delete, type cd “your file” and press enter to delete it. You can use the dir command to list all files in the current folder.
How To Force Delete A File That Is Already In Use By Another Program
Sometimes when you try to delete a file, Windows 10 says that the file is already in use by another program. Thus preventing you from deleting it.
Unlocker is a software that allows you to force file deletion on Windows 10 and earlier versions. Unlocker allows you to delete files locked by “Cannot delete file: Access is denied”, “Cannot delete files” or “The file is in use by another program or user” message errors. This free tool is a must to completely solve the problem of unlocked files by forcing their deletion regardless of the error message (except when deleting system files). Unlocker is able to kill processes thus force delete a file that was used by other programs, force renaming and moving locked files. It is one of these softwares that should be installed on every system.
It’s one of those programs that should be installed on every system. There’s nothing more frustrating than not having total control over your computer files.
To force file delete using Unlock, follow the steps below:
- Download and install Unlocker
- Right-click on the file you want to force delete
- Click on Unlocker
- Click on the “Unlock & delete” button to force delete the file.
This should force delete the file and remove it even if it is in use. If that didn’t work, retry the same procedure using the Force Mode by checking the “force mode” checkbox.
How To Force File Delete by Closing All Applications
Sometimes Windows 10 displays an error message like “The action cannot be performed because the file is opened in another program.“, As the error message says, your file is being used by another program or process (without a visible window). The only way to delete this file is to close the process of the application that is blocking the file. To do this, follow these steps
First check that your file is not being used by a background application or hidden process. If so, close the window in question and try to delete the file again. The name of the file, its type or the folder it is in can sometimes help you determine which program might be using it.
If you can’t determine which program is using this file, close all open applications, including those running in the background without a visible window (use the task manager to close processes not required by the system to run.) and try to force the deletion of the file again.
If it still doesn’t work, restart your computer and try to delete the file normally.
How To Force Delete Files in Windows 10 By Booting In Safe Mode
Safe mode is a mode in which Windows loads only the essentials. It thus works in a lighter version, without being burdened with certain services and programs, and is often used to solve problems.
By booting in Safe Mode, Windows will not start non-essential programs and services that could block the files you want to delete.
To force delete a file in Windows 10, boot in safe mode and remove your files normally from Windows File Explorer.
How To Force Delete A File That “Cannot Be Found”
If Windows 10 tells you that the file you want to delete cannot be found, you can bypass Windows 10 Explorer using a file compression and archiving software, such as 7-Zip or WinRAR.
Follow the steps below to force the deletion of files using 7-Zip.
- Open 7-Zip
- In 7-Zip, browse through your PC folders to find the file you want to delete.
- Select the file and click delete.
- Confirm the deletion by clicking on Yes.
How To Force Delete A File Used By Another Process Using Process Explorer
There are times when Windows prevents a file from being deleted because an application – or one of its processes – that you don’t see that is actually using the file. In this case, you need to be able to identify the application and force it to terminate. You can this by using a specialized and free software such as Process Explorer.
- Download and install Process Explorer
- Click on Find in the menu, then click on”Find handle or DLL”.
- Enter the name of the file you want then click the Search button.
- Process Explorer will then search for the process using your file.
- Right-click on the process using your file then click on “Kill process”.
- Once the process is forced to stop. Delete your file normally.
How To Force Delete A File By Overwriting It
A simple trick to forcefully remove a recalcitrant file is to try to replace it with a file with the same name, forcing Windows to overwrite it.
In another folder than the file to be deleted, create a new empty file with the same name as the file you want to delete. Then copy and paste the created file into the folder where the file to be deleted is located. Windows will ask you if you want to replace it, click Yes to overwrite the file. You will then be able to delete the file you have created.
See also: How To Split A File Into Several Parts