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.
What you'll need
- Administrator account
Step-by-step diagnostic
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.
- Close programs End processes that may be using the file.
- Take ownership Properties, Security, Advanced, Change owner.
- Command Prompt del /f "path" as Administrator.
- Safe Mode Boot Safe Mode; delete.
- 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.
You can change your answer later.
Close the program
Did delete work?
After closing programs, delete may succeed.
You can change your answer later.
Take ownership and delete
File deleted
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.