Now and again, something happens within Windows to cause a file to be deleted or even renamed. Even the very best operating systems sometimes have a little glitch from time to time. That’s why I have decided to show you how to force delete a file in Windows 10.
You may also notice that the very same file likely cannot be moved, renamed, deleted, or any attribute can be changed.
Here is a surefire way to get rid of files that are in a way ‘locked’ and cannot be removed.
It may seem like quite a process, but I assure you will get through it just fine. Take the procedure a step at a time.
Tip: Please backup your files before deleting anything. At the very least, create a second copy of your files or folders into a zip file and move them elsewhere.
Step 1: Open the command prompt with admin rights
Open the Start Menu and type ‘run’ (without quotes):
You will notice that your typed text will show at the bottom next to a magnifying glass symbol.
After that, click on the Run Desktop App menu item.
Type in ‘cmd’ (without quotes) in the Run text box. Click on ‘Ok’:
You will see a command window box that has been opened:
You will have your user name instead of mine. So don’t worry if the line of text looks a little different.
Step 2: Locate the file or folder and use the delete command
You can find the location of your file by right-clicking on the location bar in your explorer window where you first had the file open:
Select Copy address as text from the context menu.
Click on the command window and hold the Ctrl key and tap the ‘V’ key.
You will see the location has been pasted into the command window:
Move your cursor over to the left of the text you have pasted by holding down the left arrow key on your keyboard.
Then add ( Include double quotes, the space between del and the /, and then space between the f and ” ):
del /f “
Tip: If your letters are replacing the existing text as you type, press the insert key once.
Then hold your right arrow key down on your keyboard until the cursor is at the end of the line of text.
Type one more \\ and then the name of the file you want to get rid of (no extra spaces).
Then complete the line by typing another ” at the end of the line. Make sure you haven’t added any unnecessary spaces.
It should now look like this:
We also include the double quotes just to make sure that Windows understands the full path correctly, even if there are a lot of spaces between words.
You can press enter once you are satisfied. This will execute the command.
If all went well, your file should be gone!
Info Bit: The last three characters of your filename after the period, is called the extension. They tell operating systems what type of file they are. Read more about them in our other article, where we show you how to see them in File Explorer.
You can use the same command for folders by replacing the file name with the folder name. Obviously, you won’t have an extension for a folder either.
After you have entered the command, go back and check it in Explorer to see if it’s gone. You may have to refresh the window by clicking on the refresh button:
If this method fails
We aren’t fans of adding extra software to execute a task in Windows. However, you may be in a situation where the previously mentioned method didn’t work. In this case, go ahead and download LockHunter to delete the file.
If for some reason you cannot get files removed from your computer, even after trying everything we suggest, have a look at our article showing how to stop your computer from sending automated queries. It’s a complete guide to get your computer cleaned up nicely.
And that will be the end of that annoying file. This will be a handy technique for you to use in the future, so consider bookmarking it in your browser’s favorites.