How to Force Delete Undeletable Files in Windows

How To Force Delete Undeletable Files In Windows

There can be many situations where Windows will prevent you from deleting a particular file. The file could be in use, you may not have the privilege to access it, or the file itself may have an issue. No matter the reason, there are solutions to this problem. This tutorial shows you how to delete an undeletable file in Windows.

Tip: Open large files in Windows without lag using these programs and utilities.

1. Use the Force Delete Shortcut

Windows features a keyboard combination that allows users to permanently delete a file. It will be eliminated from the system without being moved to the Recycle Bin first.

To permanently delete a file, first select it, then hold Shift and press Delete. Windows will ask you whether you really want to permanently delete the file. Select “Yes” to continue the process.

Force deleting a file in Windows.

2. Restart the PC

In most cases, a simple reboot is all you need to fix such issues. It’s possible that a problem with the system files is to blame for this, and restarting the computer will give them a clean slate to work from, hopefully solving the issue.

3. Force Close Apps Running in the Background

Windows won’t delete a file if it is currently being used by a program. If there is a program that is still implementing the file, simply close the program and try deleting it again.

There is also a chance that a program has a background process that is still using the file. Follow these steps to force close the app.

  1. Right-click on the Start menu and select “Task Manager.”
Opening up "Task Manager" from Quick menu in Windows.
  1. Look for a process associated with a program that you think might be using your target file. Once you’ve found it, select it and click on “End task” to stop it.
Finding a process in Task Manager and ending it.
  1. You should be able to delete the file now.

Good to know: you can use PowerShell to hide Windows updates when they’re popping up at an inconvenient time.

4. Use Windows PowerShell

Windows PowerShell is a powerful console command that can do anything if instructed correctly. For instance, you can force delete the undeletable files or apps from your PC by following the steps below:

  1. Find the file you want to delete using File Explorer, then right-click it and select “Copy as Path.” Exit File Explorer.
"Copy as path" option when right-clicking a file in Windows.
  1. Right-click on the Start menu and select “Windows Terminal (Admin)” or “Windows PowerShell (Admin).”
Opening Windows Terminal (Admin) from Quick menu in Windows.
  1. Type in del followed by a space, then press Ctrl + V to paste the path you copied earlier. Finally, press Enter.
Deleting file with PowerShell in Windows.

5. Take Ownership of the File

If Windows is giving an error that you don’t have the privilege to delete the file, then it must be an ownership issue. Usually, this happens when you upgrade Windows or there are multiple user accounts set up on the computer. Thankfully, if you are the administrator of the PC, you can easily take back ownership of any file, then delete it. To make things easier, you can even add a “Take ownership” option in the context menu in Windows using a third-party app.

  1. Visit the official page of Winaero Tweaker and download the tool.
  2. Open the installation package, click on “Normal mode” and “Next,” then let the installation process finish.
Installing Winaero Tweaker on Windows.
  1. Open the app, scroll down in the left pane, click on “Take Ownership,” then enable the “Take Ownership context menu” option.
"Take Ownership" option in Winaero Tweaker.
  1. Go to File Explorer, find the file you want to delete, right-click on it, then select “Take Ownership.”
"Take Ownership" option added to context menu in Windows.
  1. Try deleting the file again.

Tip: can’t see the Windows login screen? Try these tips to get it back.

6. Use a Third-Party App

There are also third-party apps to fix common problems that lead to a file getting locked and unable to delete. We have used the IObit Unlocker app for this purpose many times, and it has always managed to fix the problem. It even fixed the “Too long name” error that makes a file undeletable. If the above methods don’t work for you, try IObit Unlocker.

Once you have installed the app, it will let you unlock files and folders through its dedicated interface.

  1. Download the IObit Unlocker and install it.
  2. Open the app and click on “Add.”
Adding file in IObit Unlocker in Windows.
  1. Find and select the app you want to remove.
  2. Enable “Force Mode,” click on the downward arrow next to “Unlock,” select “Unlock and Delete,” then click “OK.”
Unlocking file in IObit Unlocker for Windows.

Other third-party apps you can use include LockHunter and EMCO UnLock IT.

7. Boot into Safe Mode

If nothing works, then either the file is infected by malware, or the system itself is using the file. In both cases, booting your PC into Safe Mode should allow you to delete the file. Safe Mode only loads the minimum of required drivers and system files, and most types of malware are also halted.

  1. Press the Windows + R keys to bring up the Run application.
  2. Type in msconfig and hit Enter.
Typing "msconfig" in Run window.
  1. Go into the “Boot” tab and select “Safe boot.” Make sure the “Minimal” option is selected underneath.
"Safe boot" option under System Configuration.
  1. Click “Apply -> OK” and restart your PC. Try removing the file when your PC boots into Safe Mode.
Initializing Safe Boot in Windows.

Tip: need to download a utility on your PC? Check out these websites to safely download Windows software.

Frequently Asked Questions

How do I recover deleted files if I need them again?

First, check your Recycle Bin. If the file is there, you will have the opportunity to restore it. If it’s not in the Recycle Bin, there is a chance that your hard drive still has the file. You can extract it using file recovery software such as Disk Drill. Alternatively, you can try these other methods to restore your deleted files.

Can I delete a file using CMD instead of Windows PowerShell?

Most commands that work with PowerShell also work with Command Prompt, so if your PC doesn’t have PowerShell, you can use the commands stated above with Command Prompt. Just make sure to run the console as an Administrator.

Image credit: Pexels. All screenshots by Farhad Pashae.

Farhad Pashaei
Farhad Pashaei

As a technophile, Farhad has spent the last decade getting hands-on experience with a variety of electronic devices, including smartphones, laptops, accessories, wearables, printers, and so on. When he isn’t writing, you can bet he’s devouring information on products making their market foray, demonstrating his unquenchable thirst for technology.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox