🤯 50% Off! 700+ courses, assessments, and books

How to Force Windows to Delete a File

    Adam Roberts

    Sometimes, for whatever reason, Windows will become convinced a given file or folder is in use by a program and prevent it from being deleted, moved or renamed. This locking up of files is incredibly frustrating, especially when you know the file is not, in fact, being used. Here are two ways to get around that issue.

    1. Force delete using Shift + Delete

    Perhaps the simplest way to force delete a file in Windows is to use the keyboard shortcut. Select the file or folder you wish to delete, then press Shift + Delete. Note that this deletes files permanently; it won’t be placed in the Recycle Bin.

    If that doesn’t work, you can try using the Command Prompt, which offers advanced deletion commands.

    2. Force delete using the Command Prompt

    First, open the command prompt. To do this, start by opening the Start menu (Windows key), typing run, and hitting Enter. In the dialogue that appears, type cmd and hit Enter again.

    Run dialogue box

    With the command prompt open, enter del /f filename, where filename is the name of the file or files (you can specify multiple files using commas) you want to delete. Microsoft’s documentation describes more details on advanced deletion methods using this command.

    Note that to delete the file you’ll need to either include the full path of the file where you replace filename, or navigate to the folder it is contained in using cd folderpath, and then run the del command. See the image below for an example of the latter method.

    Using the command prompt

    There you have it, two simple methods for fixing a stubborn issue!