When a file is open by another app or process, Windows 10 puts the file into a locked state, and you can't delete, modify, or move it to another location. Usually, after the file is no longer in use, the application will unlock it automatically, but that's not always the case. Sometimes, a file may not unlock successfully, and even if you try to take any action, you'll see a warning that the operation can't be completed because it's open by another program.
If you must delete or take different actions with a locked file, there are at least two methods you can use to unlock it, including using Microsoft's Process Explorer tool and Safe Mode.
In this Windows 10 guide, we walk you through the steps to get rid of files even if they're locked by an app or process.
How to unlock files using Process Explorer
If you need to unlock a file currently being used by a program or system process and you can't restart your device, you can use these steps:
- Download Process Explorer from this Microsoft website.
- Extract the content inside the ProcessExplorer.zip compressed folder. (You can refer to these instructions if you need additional help on how to do this task.)
- Double-click the procexp.exe if you're running a 32-bit version of Windows 10 or procexp64.exe if you're running a 64-bit version10 to launch the app.
- Click on File, and select the Show Details for All Processes option.
- Click on Find, and select the Find Handle or DLL option.
- Type the name of the locked file in the field, and click the Search button.
- Select the file from the search result.
- Behind the search window, in "Process Explorer," right-click the locked file, and select Close Handle to unlock it.
- Important: If the file is being used by more than one process, repeat the steps to close all handles.
Once you complete these steps, you can go ahead and safely delete or modify the unlocked file.
How to unlock files using Safe Mode
Usually, when you come across a locked file, you can simply restart your device to unlock it. However, if the application has a service that loads during startup, it might keep locking a file as soon as you sign in. You can either disable the app from loading at startup, or you can boot into Safe Mode to unlock and delete the file. Here's how:
- Open Settings.
- Click on Update & Security.
- Click on Recovery.
- Under "Advanced Startup," click the Restart now button.
- Click on Troubleshoot.
- Click on Advanced options.
- Click on Startup Settings.
- Click the Restart button.
- On "Startup Settings," press F4 to enable Safe Mode.
While in Safe Mode, use File Explorer to locate and delete the files that were previously locked, then simply restart your device as you would normally to exit Safe Mode.
Wrapping things up
Although there a number of tools available on the internet designed specifically to deal with locked files, on Windows 10 there is more than one way to remove these type of files without having to get software from unknown sources.
It's important to note that unlocking and deleting files on Windows 10 may cause system and program issues, depending on the type of files you're trying to unlock. So be careful of what you delete if you're not sure of the consequences.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
- Windows 10 on Windows Central – All you need to know
- Windows 10 help, tips, and tricks
- Windows 10 forums on Windows Central
Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.
For earlier Windows there was a nice Tool called "Unlocker". In Windows 10 it has some trouble showing the Context menu, but I think it's still working. Maybe an update is needed.
Great program. I been using it for years.
Unlocker still is available and still works. You need to go through their tool and hunt and peck for each file which is a pain. Also if you are going to restart Windows, that alone will unlock most files.
lock hunter is much better
Thank you, I'll give it a try
Still frequently having this super annoying issue deleting thumbs.db file although creating thumbnail is unchecked in folder preferences. Therefore now empty folder containing only that dumb thumb file will not delete unless I restart...
Windows can't delete opened files, but Linux and Mac can. Though I understand Windows and NTFS have some advantages over other OSes, the incapability forces users to reboot PC many times on Windows Update and intalling programs. This should be fixed in Windows 10, it's more important than implementing Fluent design.
I wonder why they made it so cumbersome to boot into safe mode? Didn't it used to be F8 while booting? I may check out that process explorer just for the fun of it. Sounds interesting.
Get the best of Windows Central in in your inbox, every day!
Thank you for signing up to Windows Central. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.