How To Delete Locked Files in Windows

Deleting files from your computer is usually a simple task, but some files can make this process harder than expected. Namely, some files may be locked and cannot be removed because they’re used by a program, the Windows OS, or other reasons.

How To Delete Locked Files in Windows

Locked folders cannot be opened, deleted, or moved in Windows until the password is used, and finding a password for files you didn’t lock may not be possible. Although the “Delete” option will be visible, you won’t be able to click on it and delete the file.

However, if you want to delete a locked file, you can try a couple of approaches. In this article, we’ll walk you through the different methods available.

Safe Mode

The most common approach is to reboot your Windows PC in Safe Mode to delete a locked file. Here are the steps to do so:

  1. Open the Start menu by clicking the Windows logo in the bottom-left corner.
  2. Select the gear-shaped symbol “Windows Settings” icon.
  3. Choose the Windows “Update & Security” option.
  4. Select the “Recovery” option. It’ll be on the left corner of the screen.
  5. Click the “Restart Now” button. This will restart your computer and take you to the “Advanced Options” panel.
  6. Select “Troubleshoot.”
  7. Navigate to the “Advanced” tab in the screen center.
  8. Select the “Startup Settings” options on the right side.
  9. Click the “Restart” button at the bottom of the window.
  10. Choose “Enable Safe Mode” from the drop-down menu. 
  11. On the “Startup Settings” window, press “4” or “F4.”

Let Windows complete its restart. Enter your password if necessary. Once the operating system has completed the boot:

  1. Locate your file by opening the Start menu, then the “File Explorer.”
  2. Click the earlier locked file, then the “Home” tab, and then “Delete” in the following toolbar. Alternatively, you may select the file by clicking on it and pressing the “Delete” key.
  3. Remove everything from the Recycle Bin. Your file should be removed from the system.

You can exit Safe Mode by restarting your computer after removing your file.

Process Explorer

You can also use Windows Process Explorer to delete a locked file. For some users, this approach might be more convenient. Follow these steps:

  1. Access the locked file. Just double-click the file to move it to the “Running” section of the PC’s Task Manager.
  2. Navigate to the Process Explorer webpage.
  3. Click the “Download Process Explorer” button. This will allow the Process Explorer ZIP archive to be downloaded to your PC.
  4. Double-click it in the location folder to open the “” folder.
  5. Select the “Extract to” option on the top of the screen. A toolbar will display.
  6. Choose “Extract all.” When you click it, a new window will appear.
  7. Click “Extract.”

From here, the Process Explorer program will be installed, and the installation folder will open. Now, it’s time to use Process Explorer:

  1. Launch “Process Explorer.” If your PC has a 64-bit CPU, double-click the “procexp64” item in the folder. If your system is equipped with a 32-bit CPU, double-click “procexp” instead.
  2. When asked, select “Agree.” This will launch the primary Process Explorer window.
  3. Select “File” and choose “Show Details for All Processes.”
  4. When asked, select “Yes” to minimize Process Explorer.
  5. Select “Find.”
  6. Choose “Find Handle or DLL…” A search bar will appear.
  7. Fill in the text box with the name of the locked file, then click the “Search” button to the right of the text field.
  8. Choose the locked file. In Process Explorer, look for the highlighted file name towards the bottom of the screen.
  9. Right-click the filename and choose “Properties.”
  10. Click the “Close Handle” button. By doing so, the file is unlocked, and you can delete it.

Finally, it’s time to remove the locked file:

  1. Locate your file. Open the Start menu, then the File Explorer and find the formerly locked file.
  2. Remove the file. Click the previously locked file, then the “Home” tab, and “Delete” in the toolbar. Or, you may select the file by clicking on it and then pressing the “Delete” key.
  3. Remove everything from the Recycle Bin.

Command Prompt

Another way to delete a locked file is to use the Command Prompt. Follow these steps to do so:

  1. Launch the Command Prompt by typing “Command Prompt” in the Windows search box.
  2. Select “Run as administrator.”
  3. Type “del /f file name” in the popup box and press “Enter.” Please keep in mind that you must change the file name with the name of your own file.

Note that a file deleted using the Command Prompt cannot be retrieved if you change your mind.

Run Chkdsk

First and foremost, open the Command Prompt window and run it as administrator. The steps to do so can be found above. To proceed, follow these steps:

  1. Type “chkdsk c: /f /r /x” into the command line window and press Enter. You can alter the drive letter if it is not C.
  2. Find your file.
  3. Delete the file.
  4. Empty the Recycle Bin.

Change the File Extension

Sometimes, this is the simplest way to erase a file that won’t be removed when you press the “Delete” key. If you have a file named filename.mp3, click it in File Explorer, press F2, and replace the extension (.mp3) with anything else, such as.txt.

However, you must first enable file extensions since Windows hides extensions for recognized file types by default. Go to the “View tab” and check the ‘File name extensions’ box to allow extensions on Windows.

Have Control Over Your Files

Even though these methods aren’t as straightforward as just simply deleting a file, sometimes these methods are the only way. Remember that Windows versions are different, and the steps may vary, but the main idea stays the same. The most significant difference is that the File Explorer is Windows Explorer in older versions.

Some third-party apps and programs can assist you in deleting a locked file. However, be careful with them. Please do your research before downloading them. Some might carry malware and harm your files.

Have you ever had trouble deleting a file? How did you solve it? Let us know in the comment section below!

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.

Todays Highlights
How to See Google Search History
how to download photos from google photos