How to force delete files in Windows 10

If Windows prevents you from deleting a file, you can use a single command to force delete the file from the command line. Here's how you do it.

If Windows prevents you from deleting a file, you can use a single command to force delete the file from the command line. Here's how you do it.

How are files in Windows deleted?

You can usually delete almost any file or folder by pressing a button Deleteon the keyboard. Once deleted, the file will be moved to the Recycle Bin so you can restore deleted data as needed. To bypass the Recycle Bin and permanently delete a file, you can use the keyboard shortcut Shift+ Delete.

When a file is being used, it cannot be deleted in normal ways. If you try to do that, you may receive the "Access Denied: File in use" error message . This is mainly because the file is locked by an application. There is usually no simple way to know which application is blocking a file and prevent you from deleting it.

In those situations, you can execute a command to force the deletion of files.

Important note : Before forcing deletion, make sure that no important data is stored in the file and that it is safe to delete the file. Also, make a backup before deleting the file. Once deleted, you cannot recover files.

Force delete file

To force delete a file in Windows, we will use a single command line. As soon as you execute the command, the target file will be deleted.

1. The first thing you need is the file path. Open File Explorer and go to where the file is stored. Next, click on the address bar and copy the path.

How to force delete files in Windows 10 Picture 1How to force delete files in Windows 10 Picture 1 Copy the file path

2. Now, open the Command Prompt with admin rights.

3. In the Command Prompt window , execute the command below, replacing X with the actual drive letter. For example, the article file is stored in drive E :. So E is entered in the command below.

If the file you are trying to delete is in C drive, you can skip this step.

X:
How to force delete files in Windows 10 Picture 2How to force delete files in Windows 10 Picture 2 Execute the command with the file drive to be deleted

4. When you are in the destination drive, execute the command below, replacing it with the actual path you copied earlier.

cd "E:DummyFolder"
How to force delete files in Windows 10 Picture 3How to force delete files in Windows 10 Picture 3 Execute the command with the copied file path

5. This step will take you to the file directory. Now, execute the following command, replacing fileName.ext with the actual file name along with the extension.

In the example case, the file to be deleted is a zip file. So the file name along with the .zip extension is entered.

del /s /q "fileName.ext"
How to force delete files in Windows 10 Picture 4How to force delete files in Windows 10 Picture 4 Execute the command with the actual file name along with the extension

6. If Windows can delete the file, you will see a Deleted File response .

4 ★ | 1 Vote