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.
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.
- Right-click on the Start menu and select “Task Manager.”
- 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.
- 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:
- Find the file you want to delete using File Explorer, then right-click it and select “Copy as Path.” Exit File Explorer.
- Right-click on the Start menu and select “Windows Terminal (Admin)” or “Windows PowerShell (Admin).”
- Type in
del
followed by a space, then press Ctrl + V to paste the path you copied earlier. Finally, press Enter.
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.
- Visit the official page of Winaero Tweaker and download the tool.
- Open the installation package, click on “Normal mode” and “Next,” then let the installation process finish.
- Open the app, scroll down in the left pane, click on “Take Ownership,” then enable the “Take Ownership context menu” option.
- Go to File Explorer, find the file you want to delete, right-click on it, then select “Take Ownership.”
- 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.
- Download the IObit Unlocker and install it.
- Open the app and click on “Add.”
- Find and select the app you want to remove.
- Enable “Force Mode,” click on the downward arrow next to “Unlock,” select “Unlock and Delete,” then click “OK.”
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.
- Press the Windows + R keys to bring up the Run application.
- Type in
msconfig
and hit Enter.
- Go into the “Boot” tab and select “Safe boot.” Make sure the “Minimal” option is selected underneath.
- Click “Apply -> OK” and restart your PC. Try removing the file when your PC boots into Safe Mode.
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.
Our latest tutorials delivered straight to your inbox