Locked files on your PC are - well-locked files which you can't access without a password. Without the password of such file, you can't open, delete or even move such file.
There are certain locked files which weren't probably locked by you, and as such, there is no way you would know the password of such file. In such situation, you can't delete such file, but you can delete it. However, a simple right click > Delete won't work or even pressing the delete button on the keyboard will not work.
It is, however, important that you note that deleting lock files which you do not know how they got on your system could be harmful to your PC. It's better to be sure what kind of file it is you want to delete before you proceed.
How To Delete a Locked File in Windows 10
- Find the location of the file or folder you want to remove.
- Open your browser on your PC
- Search for "Process Explorer and download it from Microsoft's website and click OK on the window that pops-up.
- Next, we need to extract the file. Click on processexp64 to extract the file.
- Click Extract All.
- Click Open.
- Double click the procexp64 to launch the app.
- Click Run
- Go through the terms of the application and click the Agree button.
- When the Process Explorer window opens, click File.
- Click Show Details for All Processes.
- Give the application permission to make changes by clicking on Yes.
- Click the find menu on the application.
- Click Find Handle or DLL.
- In the search box that comes up, type in the name of the file you wish to delete.
- Click Search.
- Right click the process at the bottom of the Process Explorer window.
- Click Close Handle. If multiple processes come up, you will need to do this for all of them.
- Delete the file just as you would to a regular file.