How to delete locked files or folders

zuvapatrick@gmail.com' By: Patrick Zuva
3 minute read
delete locked files folders

Computers are designed to be smarter than the people who use them. And for the majority of times, they indeed are, helping us to execute wildly complex tasks faster and with remarkable efficiency. But sometimes they confound us by failing to complete tasks that seem straight forward even to us.

An example is when your Windows computer refuses to delete a file or folder. Other times it will also refuse to move or rename a file. The computer will give you different reasons for refusing to delete your selected file. It will tell you:

  • The file, its source, destination or directory may be in use by another program
  • Access is denied
  • There is a sharing violation somewhere
  • That the file is unreadable or is corrupted, etc.

Of course, if the computer tells you the file is open in another program, usually one you have opened yourself, closing that program first should unlock the file or folder for deletion. That should be straight forward. But there are cases, as with some background processes, where you can’t immediately tell which program currently has the file open.

How to delete locked files

Just to be sure, Windows system files are locked for a reason. In case you end up in the Registry while trying to fix something, avoid deleting any files or folders there. If unsure what to do, consult a professional. But for locally stored files that you know are safe to delete, but for some reason won’t oblige, there are a few tricks you can try;

Solution 1 — Restart your computer

Sometimes exiting the programs you are in and restarting your computer maybe all you need to delete a stubborn file. Restarting the computer reboots your system and clears it of any temporary bugs that may have locked your file.

But when it is the Windows startup program itself that is locking your file, simply restarting the computer may not unlock it. If you notice restarting the computer isn’t doing the trick, try restarting it in safe mode and deleting the file, before considering other fixes. You can switch back to normal mode after you have deleted the file.

Solution 2 — Use Windows’ Command Prompt

A quick way to force file deletion is to go the CMD route. Open the Run dialog box, type in cmd, and hit the enter key. Once you are in command prompt, type del /f file name and press enter key.

Remember to replace file name with your own file’s name. This should delete the file. However, please note you won’t be able to retrieve the file once you have deleted it this way.

Solution 3 — Use third party file deleting software

Another way to delete a locked file is by using third party software that’s specially written for the purpose. There are several options available, but Unlocker is a popular one. Some of these will also make it painless to rename and move locked files.

Most third party software for deleting locked will require you to download and install them on your computer. However, there are others, like the Process Explorer task manager, are portable and won’t require you to install them on your machine.

Process Explorer is particularly useful as it also shows you which processes are currently running at a given time, as well as the processes’ owning accounts.

The Process Explorer software gives you greater insight into the Windows OS. Among other functions, the tool can tell which process is running any open window, suspend or kill a running process, and, importantly, figure out which process has locked the file you are trying to delete.

Any one of the solutions we have discussed here should help you delete any file you may have been struggling with and, hopefully, put you back in command of your machine again. If you find this problem cropping up repeatedly, you should consider cleaning your computer. There is always a possibility a stubborn bug or virus attack could be messing with your files.

RELATED ARTICLES YOU NEED TO CHECK OUT:

For various PC problems, we recommend to use this tool.

This tool will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Quickly fix PC issues and prevent others from happening with this software:

  1. Download this PC Repair Tool with Microsoft Technologies
  2. Click “Start Scan” to find Windows issues that could be causing PC problems.
  3. Click “Repair All” to fix all issues (requires upgrade).