How to Delete Locked Files in Windows
If Windows not letting you delete a file, it's probably because the file has a open handles by process or processes which is why file is locked and can't be deleted.

Usually, after the file is no longer in use, the process should automatically unlock file, 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.

Here are the steps to unlock and delete it.

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:

1. Download Process Explorer from this Microsoft website.

2. Extract the content inside the ProcessExplorer.zip compressed folder.

3. Right-click the procexp.exe if you're running a 32-bit version of Windows and select Run as administrator, you will need to run procexp64.exe if you're running a 64-bit version of Windows, make sure to run it as a administrator.

4. At the Process Explorer window click on File, and select the Show Details for All Processes option.

How to Delete Locked Files in Windows 35rub0e

5. Click on Find, and select the Find Handle or DLL option.

How to Delete Locked Files in Windows TVrDiCO

6. Type the name of the locked file in the field, and click the Search button.

How to Delete Locked Files in Windows FYoM165

7. Select the file from the search result.

8. Behind the search window, in "Process Explorer," right-click the locked file, and select Close Handle to unlock it.

How to Delete Locked Files in Windows KCpjmy6

If the file is being used by more than one process, repeat the steps to close all handles.

Hopefully after you have complete these steps, you can go ahead and safely delete or modify the unlocked file.

If you're still having problem deleting the 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.

If you want to know how to start Windows XP, Vista and Windows 7 into Safe Mode, please check out below tutorial.

How to Boot Windows 7 into Safe Mode

If you want to know how to start Windows 8, 8.1 and Windows 10 into Safe Mode, please check out below tutorial.

How to Boot Windows 10 into Safe Mode