Windows errors

Can't delete a file because it says it's 'in use' or 'open in another program'

Trying to delete, rename, or move a file results in a message saying it's currently open in another program or being used by another process, even when you've closed everything you can see.

Difficulty
Easy
Time
10–20 minutes
DIY cost
$0
Pro cost
$0–$60

Symptoms

  • Error message mentions the file is open or in use elsewhere
  • The program you think is using it appears to be closed
  • Retrying the delete a few times doesn't help
  • May involve a file that was recently used or is in a shared/synced folder

Likely causes

  • CommonA background process still has the file openSome programs keep files open in the background even after their main window is closed.
  • CommonFile is being synced by cloud storage software (OneDrive, Dropbox, Google Drive)Sync clients often lock files briefly while uploading or checking for changes.
  • PossibleA crashed program left the file handle open without fully closingWhen software crashes, it doesn't always release files properly.
  • PossibleWindows Explorer itself has a lingering preview or thumbnail lock on the fileExplorer's preview pane or thumbnail generation can hold a lock briefly.
  • Less commonAntivirus software scanning the file at that momentA security scan in progress can temporarily lock a file from other operations.

What to do

  1. Close any programs that might reasonably have the file open, including background apps you might have forgotten about, and try deleting again.
  2. Check the system tray (bottom-right icons) for cloud sync software like OneDrive or Dropbox, and pause syncing temporarily before trying again.
  3. Restart File Explorer via Task Manager (find Windows Explorer, right-click, Restart) in case Explorer itself is holding a stale lock.
  4. Use Task Manager's 'Details' tab to look for the specific program's process still running in the background and end it if it's safe to do so.
  5. Try deleting or moving the file from a Command Prompt using 'del' instead of File Explorer, which sometimes succeeds when the graphical method doesn't.
  6. If none of this works, restart the computer, which releases essentially all file locks, then try deleting the file immediately after restart before other programs load.
  7. For a file that's persistently locked by cloud sync software, check that software's own status to confirm the upload or sync has genuinely finished before retrying.

When to call a pro

If a file remains undeletable even after a restart, a technician can use specialized tools to identify exactly what's holding the lock.

Safety

Generally low risk

Generally low risk for a careful person. Stop if anything looks different from what this guide describes.

Related guides

Operator provides AI-generated troubleshooting information. It can be wrong. For safety-critical, electrical, gas, structural, medical, automotive safety, or other high-risk problems, consult a qualified professional.