Practical computer help for real-world problems.
Menu

Files & Storage / File Permissions

How to Delete a File That Won't Delete in Windows

Quick answer

Close the app that owns the file, turn off Explorer's Preview pane, then try Delete again. If Windows names a program, end that program in Task Manager, not a random PID. Restarting the PC still beats unofficial "unlocker" tools. Folders under Windows or Program Files that refuse to delete are often supposed to stay.

Practical PC editorial teamUpdated November 2, 202611 min readBeginner-friendlyAbout 10 to 30 minutes

Quick diagnosis

If several of these match what you see, you are in the right guide.

  • Delete stays in the Recycle Bin or never starts
  • "File in use" or "open in another program"
  • Access denied
  • The path is too long, or a folder looks empty but will not delete

Possible causes

  • The file is open in an editor, preview pane, or cloud-sync client
  • A background process still has a handle (search indexer, antivirus scan)
  • Permissions on someone else's profile folder
  • Path length or a leftover thumbnail/lock file
  • Malware holding a file, less common than "Preview pane still open"

What you need

  • Task Manager
  • File Explorer

What this problem usually means

Windows will not remove a file that is mapped by a running program. That is protection, not a broken Recycle Bin. A different problem is a full disk that cannot complete the delete, free space first with free disk space.

Before you start

  • If this is a file you still need, copy it somewhere else before experimenting.
  • Do not take ownership of C:\Windows to force a delete.

Quick fixes

1. Close the program and the Preview pane

Quit Word, photos, video players, and Command Prompt windows whose current directory is that folder. In Explorer, hide the Preview pane (View → Show). Preview holds files open. This is the same pane that can freeze Explorer.

2. End the named process

If the error names chrome.exe or Photos, end that app in Task Manager completely (including background processes). Then delete. If it names a system process you do not recognize, do not kill csrss or winlogon. Restart instead.

Step-by-step troubleshooting

Restart, then delete before opening anything

A restart drops leftover handles. Sign in, delete the file before you open the app that was using it. If it still fails, the locker is a service that starts at boot (sync client, backup).

OneDrive and cloud files

Pause sync and try again. Online-only placeholders can error in confusing ways. Deleting in Explorer should also remove the cloud copy if that is how you have OneDrive set up, confirm in the OneDrive activity view so you do not think a file is gone when it only unsynced.

Access denied on your own file

Properties → Security is for folders you own. If this is another user's folder, sign in as that user or an administrator and delete from there. Taking ownership of random system directories is how PCs get harder to update, not easier to clean.

Path too long

Deep unzipped folders can exceed older MAX_PATH behavior. Move the folder closer to C:\ (a shorter path), then delete. Avoid installing "path unlocker" shareware.

What does the error say?

Choose an answer. The next question appears below, no account or download required.

What is Windows telling you?

Close that program and the Preview pane. Restart if Windows will not name it. Skip unlocker downloads.

You may not own the file, or it is a system file. Do not take ownership of Windows. Delete from the correct user account if it is personal data.

Shorten the path by moving the folder up. Empty folders that remain are sometimes indexer or desktop.ini delays, refresh after a restart.

How to know the problem is fixed

The file is gone from the folder and, if you used Recycle Bin, from the Bin after you empty it. A search does not keep showing a leftover copy in the same path.

If the problem continues

Boot to Safe Mode and delete there. If it still will not go, the file may be on a failing disk or held by malware. Scan with Windows Security. Unofficial unlockers are a common delivery method for more malware. If many deletes fail across the disk, check drive health.

When this may be hardware failure

A single stubborn file is usually software. Many files that cannot be read or deleted, plus SMART warnings, is storage hardware until you prove otherwise.

Common mistakes to avoid

  • Downloading IObit-style unlockers from ads.
  • Killing core Windows processes because Resource Monitor showed a PID.
  • Formatting the drive to remove one video.

Frequently asked questions

Should I use Unlocker or Process Explorer?

Microsoft Sysinternals Process Explorer can show handles, for advanced users. Casual "Unlocker" extras from the web are not worth the risk. Restart is the safe equivalent for home PCs.

The file comes back after delete.

A sync client, installer, or malware is recreating it. Pause OneDrive/Dropbox and scan with Windows Security rather than deleting in a loop.

Written by Practical PC editorial team. We write practical Windows and PC troubleshooting guides for home users, students, and office workers. Guides are researched from official documentation and widely observed support patterns, then reviewed for safety and plain language. We do not invent lab tests, certifications, or first-hand repair experience we do not have.