Share this article
Improve this guide
How to delete locked files or folders
4 min. read
Updated onOctober 4, 2023
updated onOctober 4, 2023
Share this article
Improve this guide
Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more
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 computerrefuses to delete a fileor folder. Other times it will also refuse to move orrename a file. The computer will give you different reasons for refusing to delete your selected file. It will tell you:
Of course, if the computer tells you thefile 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 filesare locked for a reason. In case you end up in theRegistrywhile 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 andrestarting your computermaybe 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 theCMD route. Open the Run dialog box, type incmd,and hit the enter key. Once you are in command prompt, typedel /f file nameand press enter key.
Remember to replacefile namewith 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 theProcess Explorertask 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 orkill 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 considercleaning your computer. There is always a possibility a stubborn bug orvirus attackcould be messing with your files.
RELATED ARTICLES YOU NEED TO CHECK OUT:
More about the topics:files
Milan Stanojevic
Windows Toubleshooting Expert
Milan has been enthusiastic about technology ever since his childhood days, and this led him to take interest in all PC-related technologies. He’s a PC enthusiast and he spends most of his time learning about computers and technology.
Before joining WindowsReport, he worked as a front-end web developer. Now, he’s one of the Troubleshooting experts in our worldwide team, specializing in Windows errors & software issues.
User forum
0 messages
Sort by:LatestOldestMost Votes
Comment*
Name*
Email*
Commenting as.Not you?
Save information for future comments
Comment
Δ
Milan Stanojevic
Windows Toubleshooting Expert
Before joining WindowsReport, he worked as a front-end web developer. Now, he’s specialized in Windows errors & software issues.