Fix Windows that has file that will not delete

We'll close the program using it, take ownership, and delete from Command Prompt or Safe Mode—or tell you when to call a pro.

Category
Troubleshooting · Home maintenance
Time
10–25 min
Last reviewed
What you'll need
  • Administrator account

Step-by-step diagnostic

Step 1 of 5

Quick triage — pick your path

Get started

Choose the option that matches what you see. You can jump straight to that section.

Show full guide

Steps

Goal: Close the program using the file, take ownership, then delete from Command Prompt or Safe Mode.

  • Close all programs. Take ownership if access denied. Delete from Command Prompt as Administrator.
  • Good: File deleted. You are done.
  • Bad: Boot in Safe Mode and delete.

Close programs

Goal: Release the file so it can be deleted.

  • Close all programs that might use the file. Task Manager, end related processes.
  • Good: File released. Delete succeeds.
  • Bad: Take ownership and try del /f from Command Prompt.

Take ownership

Goal: Get permission to delete the file.

  • Right-click, Properties, Security, Advanced. Change owner to your account. Apply. Try delete.
  • Good: Delete succeeds.
  • Bad: Use Command Prompt: del /f “full path”.

When to get help

Call a technician if:

  • The file still will not delete after Safe Mode.
  • It is a system file and you are unsure.
  • You see disk errors.

Verification

  • The file is gone from the folder.
  • No “in use” or “access denied” errors.
  • Recycle Bin shows the file if it was moved there.

Escalation ladder

Work from the device outward. Stop when the problem is fixed.

  1. Close programs End processes that may be using the file.
  2. Take ownership Properties, Security, Advanced, Change owner.
  3. Command Prompt del /f "path" as Administrator.
  4. Safe Mode Boot Safe Mode; delete.
  5. Call a pro System file; disk errors.

What to capture if you need help

Before calling support or posting for help, have these ready. It speeds everything up.

  • File path and name
  • Exact error message
  • Programs that might use the file
  • Steps already tried

Is the file open in another program?

Open files cannot be deleted.

Close all programs. Task Manager, end related processes. Good: File released—try delete. Bad: File still locked—take ownership or use Command Prompt.

You can change your answer later.

Close the program

Task Manager, end the process. Try delete. If access denied, take ownership.

Did delete work?

After closing programs, delete may succeed.

Try deleting the file. Good: File deleted—you are done. Bad: Take ownership, then del /f from Command Prompt.

You can change your answer later.

Take ownership and delete

Properties, Security, Advanced. Change owner. Then Command Prompt as Admin: del /f "path". If still failing, Safe Mode.

File deleted

The file is removed. Empty Recycle Bin if needed.

Reviewed by Blackbox Atlas

Frequently asked questions

Why would a file not delete on Windows?
A program has the file open, permission denied, or the file is locked by a system process. Close the program and take ownership first.
How do I find what is using a file?
Resource Monitor (resmon) can show handles. Open resmon, CPU tab, Associated Handles, search for the filename. Or close likely programs and try again.
When should I use Safe Mode to delete?
When closing programs and taking ownership do not work. Safe Mode runs fewer processes, so the file may not be locked.

Rate this guide

Was this helpful?

Thanks for your feedback.

Continue to