How to delete locked files or folders

by Milan Stanojevic
Milan Stanojevic
Milan Stanojevic
Windows & Software Expert
Milan has been enthusiastic about PCs ever since his childhood days, and this led him to take interest in all PC-related technologies. Before joining WindowsReport, he worked as... read more
Affiliate Disclosure
Laptop locker software
To fix various PC problems, we recommend DriverFix:
This software will keep your drivers up and running, thus keeping you safe from common computer errors and hardware failure. Check all your drivers now in 3 easy steps:

  1. Download DriverFix (verified download file).
  2. Click Start Scan to find all problematic drivers.
  3. Click Update Drivers to get new versions and avoid system malfunctionings.
  • DriverFix has been downloaded by 0 readers this month.

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.

Expert Tip: Some PC issues are hard to tackle, especially when it comes to corrupted repositories or missing Windows files. If you are having troubles fixing an error, your system may be partially broken. We recommend installing Restoro, a tool that will scan your machine and identify what the fault is.
Click here to download and start repairing.

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.


idee restoro Still having issues? Fix them with this tool:
  1. Download this PC Repair Tool rated Great on (download starts on this page).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues with Patented Technologies (Exclusive Discount for our readers).

Restoro has been downloaded by 0 readers this month.

This article covers:Topics: