Home » How To » How to Force Delete Files in Windows 10

How to Force Delete Files in Windows 10

If Windows is blocking you from deleting a file, you can use a single command to force delete the file from the command line. Here’s how.

You can generally delete almost any file or folder by simply pressing the Delete button on the keyboard. When deleted, the file is moved to the Recycle Bin so that you can recover the deleted data when needed. To bypass the Recycle Bin and permanently delete a file, you can use the Shift + Delete keyboard shortcut.

When a file is in use, it cannot be deleted in normal ways. If you try to do that, you can get the “Access Denied: File in use” error message. This is mainly because the file is locked by an application. More often than not, there is no simple way to tell which application is locking the file and blocking you from deleting it. 

In those situations, you can execute a single line command to force delete files.

Important: Before force deleting, make sure that no important data is stored in the file and it is safe to delete. Additionally, create a backup before deleting the file. Once deleted, you cannot restore the file.

Command to Force Delete File

To force delete a file in Windows, we are going to use a single line command. As soon as you execute the command, it will force delete the target file.

Quick steps:

  1. Search for “CMD” in the start menu.
  2. Right-click on the result and select “Run as administrator“.
  3. In the command line window, execute del /s /q "C:\path\to\fileName.ext" command.

Detailed Steps

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

Cmd to force delete file - copy file path

2. Now, open the Command Prompt as administrator by searching for “cmd” in the start menu and selecting the “Run as Administrator” option.

Cmd to force delete file - open cmd as admin

3. In the command prompt window, execute the below command while replacing X with the actual drive letter. For example, my file is stored in the E: drive. So, I entered E in the below command.

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

X:

Cmd to force delete file - go to drive

4. Once you are in the target drive, execute the below command while replacing the dummy path with the actual path you copied earlier.

cd "E:\Dummy\Folder"

Cmd to force delete file - go to folder

5. This will take you to the folder where the file is located. Now, execute the below command while replacing fileName.ext with the actual file name along with its extension.

In my case, the file I’m trying to delete is a zip file. So, I entered the file name along with its .zip extension.

del /s /q "fileName.ext"

Cmd to force delete file - execute delete command

6. If Windows is able to delete the file, you will see a “Deleted File” response.

Cmd to force delete file - file deleted

Wrapping Up

That is it. It is that simple to force delete a file in Windows 10. If you are still receiving errors while deleting the file, it is very probable that Windows is blocking the deletion due to insufficient permissions or some system process is using the target file. If that’s the case, reboot the system and try again.

I hope that helps. If you are stuck or need some help, comment below and I will try to help as much as possible.

4 thoughts on “How to Force Delete Files in Windows 10”

  1. Avatar for Jack Dappen

    I copied the above information to use because I cant remember everything you said. I THINK it is OK to print this out.
    I know a lot of information has been COPYRIGHTED. SO am I OK to copy the above information and print it out? Let me know.

  2. Avatar for Jeff Pimper

    How do I delete a file with this message:

    Could not find this item

    This is no longer located in D:\datafiles. Verify the item’s location and try again.

    How do I verify location when it only shows up in D:\datafiles?

  3. Avatar for Assistant. Jermy
    Assistant. Jermy

    If it says “Could not find this item”
    1. Make sure its the correct file location”
    2. Make sure it’s covered on both sides with “The file” — This problem happened to me…
    3. Make sure its ran as administrator and make sure you’re on the correct drive…
    4. Make sure at the beginning of “cd “E:\Dummy\Folder” CD is there.
    Make sure that the Slashes are facing the correct way… (/ \)
    ———————
    C:\Windows\system34> E: -- X, C
    (Drive)> cd "Drive"/(PasteFolder Here) --Or just paste the WHOLE Folder destination...
    (Drive) (Destination)>del /s /q "Name of folder"/file/DLL/ETC"

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top