Evidence Wipe
Troubleshooting

Can't Delete a File Because It Is Open in Another Program? How to Fix It

Fix 'the action can't be completed because the file is open in another program': close it, end tasks, find the process in Resource Monitor.

Updated 6 minute read The Evidence Wipe team

If Windows says "The action can't be completed because the file is open in another program", some program still has the file open. Close the program named in the message (or the one you last used the file in), wait a few seconds and try again. If that does not work, end the program in Task Manager, restart File Explorer, or use Resource Monitor to find exactly which process is holding the file. As a last resort, restart the PC and delete the file before opening anything else.

This guide works through those fixes from quickest to most thorough, explains the common hidden culprits (the preview pane, thumbnails, cloud sync and antivirus), and covers what to do once the file is unlocked if you want it gone for good.

Why Windows will not let you delete the file

When a program opens a file, it asks Windows for a "handle" and can request that nobody else changes or deletes the file while it is working. Windows honors that request to protect your data: deleting a file halfway through a save could corrupt it. The error appears in a few forms:

  • "File In Use - The action can't be completed because the file is open in [program name]" - Windows knows which program it is. Close it.
  • "...because the file is open in another program" - Windows does not know, so you need to find it.
  • "...because the folder or a file in it is open in another program" - one of the files inside a folder is in use.
  • "Access is denied" or "You need permission to perform this action" - this is a permissions problem rather than a lock; see the section near the end.

Fix 1: Close the program properly

Close the file and the program that opened it, then wait 5 to 10 seconds before trying again. Some programs, such as Office apps, PDF readers and media players, keep running in the background or in the system tray after you close the window. Check the area by the clock on the taskbar (click the up arrow) and exit any program that could be using the file.

Fix 2: Turn off the preview pane and thumbnails

File Explorer itself is a very common culprit. If the preview or details pane is showing the file, or Explorer is building a thumbnail for it, the file is open.

  • Turn off the preview pane: press Alt + P in File Explorer, or in Windows 11 choose View > Show > Preview pane (Windows 10: View tab > Preview pane).
  • Click on a different file or an empty part of the folder so the file is not selected, then select it again and delete.
  • For video files, switching the folder to Details or List view stops Explorer reading the file for a thumbnail.

Fix 3: End the program in Task Manager

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. On the Processes tab, look for the program that uses this type of file (for example Word for a .docx, a PDF reader for a .pdf, a photo or video app).
  3. Select it and click End task. Any unsaved work in that program will be lost, so save first if you can.

Fix 4: Restart File Explorer

If the file was recently opened from Explorer or is shown in a preview, restarting Explorer releases it without a full reboot. In Task Manager, find Windows Explorer on the Processes tab, select it and click Restart. Your taskbar will disappear for a moment and come back.

Fix 5: Find the exact process with Resource Monitor

When Windows will not tell you what is holding the file, Resource Monitor can. It is built into Windows 10 and 11.

  1. Click Start, type Resource Monitor and open it (or run resmon).
  2. Open the CPU tab and expand Associated Handles.
  3. Type part of the file name in the search box next to Associated Handles and press Enter.
  4. The results list each process with that file open. Right-click the process and choose End Process, or close it normally if you recognize it.

Microsoft's free Sysinternals tool Process Explorer can do the same through Find > Find Handle or DLL, if you prefer a more detailed view.

Fix 6: Pause cloud sync and check antivirus

  • OneDrive, Dropbox, Google Drive: if the file is in a synced folder, the sync app may be uploading it. Pause syncing from its icon by the clock (in OneDrive, click the icon, then the settings gear and Pause syncing), delete the file, then resume. Remember that deleting a synced file also sends it to the service's online recycle bin.
  • Antivirus: a scan in progress can briefly lock files, especially large archives and downloads. Wait for it to finish rather than turning protection off.
  • Indexing: Windows Search may be reading a newly added file. This normally clears within a minute.

Fix 7: Restart, or use Safe Mode

A restart closes every program, so the lock is released. After Windows starts, delete the file before opening anything else. If something that starts automatically grabs the file again (for example a background service or a program in your startup list), start Windows in Safe Mode: hold Shift while clicking Restart, then choose Troubleshoot > Advanced options > Startup Settings > Restart, and press 4. Only essential parts of Windows load, so the file is almost always free.

When it is actually a permissions problem

"Access is denied" or "You'll need to provide administrator permission" means your account is not allowed to delete the file, not that it is in use. Common causes are files in C:\Program Files or C:\Windows, files created by another user, or files copied from another PC or drive. If it is an ordinary file of yours, try deleting it while signed in as an administrator and click Continue when asked. If it is part of Windows or an installed program, do not force it: uninstall the program from Settings instead. Deleting system files can stop Windows or apps from working.

Once the file is unlocked: delete it properly

If you were trying to delete the file because it contains something private, remember that pressing Delete only sends it to the Recycle Bin, and emptying the bin only marks the space as free. The contents can often be recovered until they are overwritten. For sensitive files, use a file shredder or follow the steps in how to permanently delete files in Windows. If you have already deleted it normally, wiping free space overwrites the leftovers on a hard drive.

Doing it with Evidence Wipe

Once the program holding the file is closed, right-click the file in File Explorer and choose Shred with Evidence Wipe (in Windows 11 this is under Show more options), or drag it into the File Shredder. Shredding overwrites the file's contents before removing it, asks for one confirmation, and produces a verification report. Protected Windows paths cannot be shredded, which stops you damaging the system by accident. When cleaning browser data, Evidence Wipe also skips browsers that are open and shows a banner with a Close them for me button, which avoids exactly this "file in use" problem. See the features page for more.

Quick summary

  1. Close the program, including from the system tray, and wait a few seconds.
  2. Turn off the preview pane (Alt + P) and deselect the file.
  3. End the program in Task Manager, or restart Windows Explorer.
  4. Use Resource Monitor > CPU > Associated Handles to find the process.
  5. Pause cloud sync; let antivirus scans finish.
  6. Restart, or use Safe Mode if the lock comes back.
  7. For "Access is denied", fix permissions or uninstall rather than forcing it.

Frequently asked questions

How do I find which program is using a file?

Open Resource Monitor, go to the CPU tab, expand Associated Handles and search for the file name. It lists every process that has the file open.

Why does File Explorer say a file is open when I have closed it?

Often the preview pane or a thumbnail is reading it, or the program is still running in the background. Turn off the preview pane with Alt + P or restart Windows Explorer from Task Manager.

Is it safe to force delete a file that is in use?

For your own documents it is usually safe once the program is closed. Do not force-delete files in the Windows or Program Files folders, as this can break Windows or apps.

Get three guides like this every month, plus software update notices.Subscribe →