Local Tech Fix (626) 655-0020
All articles

Can't Delete a File? "The Action Can't Be Completed Because the File Is Open in Another Program" — Fixed

July 22, 2026

A file you can't delete isn't broken — something has a lock on it. Nine times out of ten it's a program you have open, a cloud sync, or Windows itself building a thumbnail. Here's how to find what's holding it and let go — free, no "unlocker" download required.

white and black eraser
Photo by Marija Zaric on Unsplash

You go to delete or rename a file and Windows stops you cold: "The action can't be completed because the file is open in another program." Or it says the file is "in use," or the delete just hangs and does nothing. It's one of the most maddening little Windows problems, because the file clearly isn't doing anything — you can see it sitting right there — and yet the computer insists it's busy.

Here's the reassuring part: the file isn't damaged, and you haven't done anything wrong. Windows locks a file while a program is using it, so that two things can't change or erase it at the same time and corrupt it. Deleting it is blocked until whatever has the lock lets go. The whole job, then, is finding what's holding it and releasing it — and every method that actually works is free and built into Windows. If your search results are full of paid "force delete," "file unlocker," or "delete locked files" downloads, you can skip them; the built-in tools below do exactly the same thing, and we'll explain at the end why the paid ones are worth avoiding.

One quick scope check first, because a couple of look-alike problems have different fixes. If the message instead says "You need permission to perform this action" or "You'll need administrator permission," that's not a lock — it's an ownership problem, and it's covered separately below. If you're trying to get back a file you already deleted by mistake, that's our recover-deleted-files guide. And if you're deleting things to free up space and the free-space number won't budge, that's a different issue our full-C-drive guide handles. This article is specifically about a file that won't delete because something has it open.

Why Windows says a file is "in use"

A lock is a program telling Windows "I'm using this, don't touch it." Sometimes the error is kind enough to name the culprit — "the file is open in Word," say — and then the fix is obvious: close Word. Often, though, it names nothing useful, or it blames a background process you've never heard of like "COM Surrogate" or "Windows Explorer," and that's where people get stuck.

The usual suspects, in rough order of how often they're to blame: a program you genuinely have open (a Word or Excel document, a PDF, a photo in a viewer, a video in a media player); a cloud service syncing the file in the background (OneDrive, Google Drive, Dropbox); your antivirus scanning it at that exact moment; the folder itself being open in another File Explorer window, or being the current folder of a Command Prompt or terminal; and the sneaky one that catches everybody — Windows Explorer itself, quietly building a thumbnail or preview of the file. Work down the list from simplest to cleverest and the lock almost always gives way.

Start simple — this clears most cases

Before anything fancy, do the obvious things, because one of them fixes it most of the time. Close the program that's using the file — and if the error named a program, close that one specifically. With Office files, don't just close the window; make sure Word or Excel has fully quit, because it can keep a document open in the background. Close any photo viewer, PDF reader, or media player that might have touched the file, and shut any File Explorer window that has that folder open.

If it's a file you keep in a synced folder, pause your cloud sync for a moment: click the OneDrive cloud in the system tray (bottom-right, by the clock) and choose Pause syncing, then try again — the same goes for Google Drive or Dropbox. If your antivirus happens to be mid-scan, give it a minute to finish, since it briefly locks each file it checks.

And the oldest trick in the book, which works precisely because it closes every open program and lock at once: restart the computer, then delete the file first thing before you open anything. If you only need this done once and don't care which program was at fault, a restart is the fastest cure there is. If the file comes back locked every time even after a reboot, the sections below will pin down exactly what keeps grabbing it.

The hidden culprit: turn off the Preview pane and thumbnails

This is the one almost nobody guesses, and it's the answer whenever the error says a file is "open in another program" or "open in COM Surrogate" while you have nothing open at all. To show you a thumbnail or a preview of a photo, video, PDF, or Office file, Windows Explorer opens the file itself — and that open handle is a lock. The moment you click the file, or even just have it visible in a folder set to show big thumbnails, Explorer is holding it.

The fix is quick. In the File Explorer window, click the View menu and make sure the Preview pane and Details pane are turned off (on Windows 11 they're under View > Show). Then click somewhere empty in the folder so the file isn't selected, and try to delete it. If a whole folder of photos or videos is fighting you, switch the folder's view to a simple list of names instead of large icons so Explorer stops generating thumbnails. For a more permanent fix on a machine where this keeps happening, open Folder Options (type "File Explorer Options" into the Start menu), go to the View tab, and tick "Always show icons, never thumbnails" — Explorer will stop trying to preview files and stop locking them for it.

If a specific media file still won't budge, the process doing the previewing is called COM Surrogate, and it shows up in Task Manager as "COM Surrogate" or dllhost.exe. Open Task Manager (Ctrl+Shift+Esc), go to the Details tab, find dllhost.exe, right-click it and choose End task — Windows restarts it automatically, so nothing breaks, but it drops the lock so your delete goes through.

Restart Windows Explorer

Windows Explorer (explorer.exe) is more than the folder windows — it draws your taskbar and desktop too, and it also holds locks on files and folders it's displaying or previewing. Giving it a fresh start often releases a stubborn one. Open Task Manager (right-click the Start button and choose it, or press Ctrl+Shift+Esc), find "Windows Explorer" in the list, right-click it and choose Restart. Your taskbar and desktop will blink for a second as they redraw — that's normal — and the lock is usually gone.

One related trap worth knowing: if you're trying to delete a folder that's currently open in another window, or that a Command Prompt or PowerShell window is "sitting in" as its working directory, Windows treats it as in use. Close those windows first. A terminal parked inside the folder you're deleting is a surprisingly common cause of a folder that "won't delete for no reason."

Find exactly what's holding it: Resource Monitor

When you've closed the obvious things and a file still won't let go, stop guessing and ask Windows directly which program has it — using a powerful built-in tool most people never open. Press Windows key + R, type resmon and press Enter to launch Resource Monitor. Click the CPU tab, and find the section titled "Associated Handles." In its search box, type part of the file's name.

Resource Monitor lists every running process that currently has that file open, right down to the program name and its ID number. Now you know the exact culprit — it might be something you'd never have suspected, like a backup app, an indexing service, or a media app running in the background. Once you've identified it, either close that program normally, or right-click it in the list and choose "End Process" to force it to let go. This is precisely the job the paid "unlocker" tools charge for, done for free by a tool that's already on your PC. Two cautions: end a process carefully, because it will lose any unsaved work in that program, and if the process is a core Windows one you don't recognize, don't force it — that's Windows telling you the file may be one you shouldn't be deleting.

The friendly version: PowerToys File Locksmith

If you'd rather not go digging through Resource Monitor, Microsoft makes a free, official tool that does the same thing with one right-click. It's part of PowerToys, a free set of power-user utilities from Microsoft — install it from the Microsoft Store (search "PowerToys"), open it, and switch on the File Locksmith toggle. From then on, whenever a file won't delete, right-click it, choose "Show more options" if you're on Windows 11, then "Unlock with File Locksmith." A window lists every program using the file, and an End Task button next to each lets you release them on the spot. It's the cleanest way to handle this if it happens to you often, and because it's from Microsoft there's no junkware risk.

Still locked? Boot into Safe Mode

If a file is grabbed the instant Windows starts — by a startup program, a driver, or a background service that won't stay closed — Safe Mode is the clean way through. In Safe Mode, Windows loads only its own essential parts and nothing you or a third party installed, so whatever kept locking the file simply isn't running. Open Settings > System > Recovery, click Restart now next to Advanced startup, then choose Troubleshoot > Advanced options > Startup Settings > Restart, and press 4 for Safe Mode. Delete the file there, then restart normally. This is overkill for an ordinary stuck file, but it reliably clears the ones that fight you on every reboot.

A word on "force delete" and "file unlocker" tools

Search this problem and you'll hit a wall of downloads promising to "force delete" or "unlock" any file — EaseUS, IObit Unlocker, LockHunter, and a dozen more. Here's the honest take. They do the same thing Resource Monitor and PowerToys File Locksmith do for free: find the program with the lock and end it. You're not getting a capability Windows lacks — you're getting a paid wrapper around a built-in one, and some of the free "unlocker" installers bundle junk software or browser toolbars you'll then have to clean off.

There's also a real risk in force-deleting. If a program is genuinely in the middle of using a file and you rip it out from under it, you can corrupt that file or crash the program and lose unsaved work. And "the file is open in another program" is sometimes Windows protecting a file you shouldn't delete at all — a system file, or something an app depends on — so forcing it can break the very program or feature you were trying to tidy up around. Use the built-in tools, understand what has the file before you kill it, and if what's holding it is a core Windows process you don't recognize, take that as a sign to leave the file alone.

The other "can't delete" errors — quick guide

A few problems look similar but aren't locks, so they need different fixes. If the message is "You need permission to perform this action" or "You'll need administrator permission," the file isn't in use — you simply don't own it or lack rights to it. The fix there is to take ownership of the file or folder (right-click > Properties > Security > Advanced, or grant your account full control) rather than to end any process; be careful, because that error often guards system files.

If the Recycle Bin itself won't empty, or a file keeps reappearing, that's usually a cloud folder re-downloading or a corrupted Recycle Bin (which you can reset). If a file lives on a network share or an external drive, the lock may be held by another computer or by the drive going to sleep. And to say it once more: if you're here because deleting files isn't giving you back any disk space, nothing is locked — see our full-C-drive guide, since the space is being held by the Recycle Bin, Windows.old, or hidden system files rather than by an app.

The bottom line

A file that won't delete is almost never broken — it's just held open, and the fix is to find what's holding it and let go. Start simple (close the program, pause cloud sync, or just restart), turn off the Preview pane and thumbnails if nothing seems to be open, restart Windows Explorer, and if it's still stuck, let Resource Monitor or PowerToys File Locksmith name the exact culprit. Every one of those is free and already on your computer, which is why the paid "unlocker" downloads aren't worth the risk.

If a file simply will not release no matter what you try — or you'd rather not go poking at processes and system folders — we're glad to sort it out. We help people across Southern California and the Coachella Valley untangle stubborn Windows problems like this in person or by remote support, and because we don't sell software, we'll always point you at the free built-in fix first and only step in when there's genuinely something odd going on underneath.

Keep reading

Free calculators

Service areas we cover

Want a second opinion before you buy?

We don't sell hardware or warranties — call and we'll tell you what's worth buying and upgrading.

Call (626) 655-0020

Gear we recommend

All gear →

Need help with your website?

For web-side work — site builds, speed fixes, hacks, broken plugins, hosting issues — head to our sister site.

Visit HelpWithWeb.com →