How to Force Delete Locked Files on Windows 11

Sometimes when you try to delete a file in Windows 11, you may see messages such as “The action can’t be completed because the file is open in another program” or “Access is denied.” These messages usually appear when the file is being used by an application, a background process, or a system service. As a result, Windows prevents the file from being deleted.

Locked files can occur for several reasons. A program may still be running in the background, the file may be protected by system permissions, or a process may still be accessing it. These situations can prevent normal deletion methods from working.

Fortunately, Windows 11 provides several ways to force delete locked files by identifying the program using the file, terminating the process, or using system tools such as Command Prompt or Safe Mode. In this guide, we will walk you through the most effective methods to force delete locked files on Windows 11.

How to Force Delete Locked Files on Windows 11

Follow the methods below to remove files that cannot be deleted normally.

1. Close the Program Using the File

If a file is open in an application, closing the program may allow you to delete it.

  1. Identify the application that might be using the file.
  2. Close the application normally.
  3. Press Ctrl + Shift + Esc to open Task Manager.
  4. Check the Processes tab for any related applications still running.
  5. Right-click the process and select End task.
  6. Try deleting the file again.

Ending the process releases the file so it can be removed.

2. Restart Windows Explorer

Sometimes files remain locked due to Windows Explorer processes.

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. Locate Windows Explorer under the Processes tab.
  3. Right-click Windows Explorer.
  4. Select Restart.
  5. Wait for the desktop to refresh.
  6. Try deleting the file again.

Restarting Windows Explorer clears temporary locks on files.

3. Force Delete the File Using Command Prompt

You can delete locked files using the Command Prompt with administrative privileges.

  1. Press Windows + S and search for Command Prompt.
  2. Right-click Command Prompt and select Run as administrator.
  3. Navigate to the file location using the cd command.
  4. Enter the following command: del /f filename.ext
  5. Replace filename.ext with the name of the file.
  6. Press Enter.

The /f parameter forces the deletion of read-only files.

4. Take Ownership of the File

If permission restrictions prevent deletion, taking ownership of the file may resolve the issue.

  1. Right-click the file you want to delete.
  2. Select Properties.
  3. Go to the Security tab.
  4. Click Advanced.
  5. Next to Owner, click Change.
  6. Enter your Windows username.
  7. Click Check Names, then OK.
  8. Enable Replace owner on subcontainers and objects if needed.
  9. Click Apply and OK.

After taking ownership, try deleting the file again.

5. Delete the File in Safe Mode

Booting into Safe Mode loads Windows with minimal drivers and services, which may prevent the file from being locked.

  1. Press Windows + I to open Settings.
  2. Click System.
  3. Select Recovery.
  4. Under Advanced startup, click Restart now.
  5. Choose Troubleshoot.
  6. Select Advanced options.
  7. Click Startup Settings.
  8. Restart and select Safe Mode.
  9. Once in Safe Mode, locate the file and delete it.

Safe Mode prevents most applications from locking files.

6. Use the Resource Monitor to Find the Locking Process

Resource Monitor can identify which process is using a locked file.

  1. Press Windows + S and search for Resource Monitor.
  2. Open Resource Monitor.
  3. Go to the CPU tab.
  4. Expand Associated Handles.
  5. Enter the file name in the search box.
  6. Identify the process using the file.
  7. End the process using Task Manager.

Once the process is stopped, you should be able to delete the file.

Conclusion

Locked files in Windows 11 can prevent normal deletion and display messages indicating that the file is being used by another program. These files may be locked by background processes, running applications, or permission restrictions.

By closing the program using the file, restarting Windows Explorer, forcing deletion through Command Prompt, taking ownership of the file, deleting the file in Safe Mode, or identifying the locking process using Resource Monitor, you can successfully remove stubborn files from your system.

Posted by Raj Bepari

I’m a digital content creator passionate about everything tech.