Skip to main content

We’d like to load Google’s advertising tag to measure how our ads perform. It sets cookies and is optional. Privacy policy.

Mudry
Guides

The file is open in another program: how to unlock it

Windows says the file is open in another program and nothing is open. How to find the process actually holding it, in about thirty seconds, without rebooting.

Roman Modrytskyi6 min read

Written by the team building Quick File Organizer, folders that organize themselves, by your rules.


You try to delete or rename something and Windows refuses: the action can't be completed because the file is open in another program. You close everything you can think of. It still refuses.

Most advice at this point is "restart your PC", which works and is a poor answer to a question with a precise one. Windows can tell you exactly which process is holding the file, and the tool ships with it.

Find the process in thirty seconds

This is the technique worth knowing, and it is built in.

  1. Press Win + R and run resmon

    Resource Monitor. No download, present on every Windows installation.

  2. Go to the CPU tab and expand Associated Handles

    A handle is a claim a process has on a file. This panel lists them all.

  3. Type the filename into the search box

    Just the name, not the path — report.docx is enough. It searches every open handle on the system.

  4. Read the process name

    Whatever is listed is what is holding your file. Right-click it and End Process if you are certain nothing unsaved is in it.

When the file is open in another program and nothing is open

Four things hold files without appearing to.

File Explorer's preview pane. Selecting a file to preview it opens it, and the lock persists while it stays selected. Turn the pane off under View, or simply click a different file.

Thumbnail generation. Explorer opens media files to draw their thumbnails. On a folder of large videos this can hold several at once.

Antivirus. Defender or a third-party scanner opens files to check them. This is brief, and it is why the error sometimes disappears if you simply try again.

A download still in progress. Browsers write to a temporary file and rename it at the end — .crdownload in Chrome and Edge, .part in Firefox. It is locked until the transfer finishes, which is also why scripts that move files on a schedule corrupt them; the mechanics are in how to automatically move files.

Restart Explorer, not the computer

If the handle belongs to explorer.exe, you do not need a reboot.

Open Task Manager, find Windows Explorer in the process list, and click Restart. The taskbar and any open folder windows disappear for a second and come back. Every file handle Explorer was holding is released.

This fixes the majority of cases where nothing you opened is responsible.

The Sysinternals option

If you prefer the command line, Microsoft's own handle.exe from the Sysinternals suite does the same job as the Resource Monitor panel and can be scripted. It is a genuine Microsoft tool rather than a download of unknown origin — worth saying, because the search results for this problem are full of "unlocker" utilities bundled with things you did not ask for. You do not need one; the capability is already on your machine.

Files on a network share

The rules change here. Windows still reports that the file is open in another program, but that program is running on someone else's computer, and Resource Monitor on your machine will show nothing at all.

On the server, Computer Management → Shared Folders → Open Files lists who has what open, and lets an administrator disconnect a session. From a client machine, the only options are asking the person or waiting.

Why this comes up constantly with automation

Anything that moves files on your behalf runs into this, and how a tool handles it separates the ones you can leave running from the ones you cannot.

A rule that tries to move a locked file has two honest options: fail loudly, or wait and retry. What it must not do is move a partial file and report success — which is exactly what a naive script does with a half-finished download.

Quick File Organizer watches folders and files new arrivals by extension, with a preview that shows what a rule will do before anything moves. Its filters match on extension, which sidesteps the still-downloading case: an in-progress file carries .crdownload or .part rather than its final ending, so a rule looking for .pdf does not see it until it is genuinely a PDF.

Common questions

Why does Windows say the file is open in another program when it is not?

Because something opened it without you noticing — usually Explorer's preview pane or thumbnail generation, sometimes an antivirus scan. Resource Monitor's Associated Handles search names the process in seconds.

Will restarting fix it?

Almost always, because it releases every handle on the system. It is also the slowest possible fix for a problem that usually takes half a minute to identify properly.

Is it safe to End Process on the holder?

It depends entirely on what it is. Explorer, yes — use Restart rather than End. An application with a document open, no: switch to it and close it normally, or you lose whatever was unsaved.

Why can I delete the file but not rename it, or the reverse?

Different operations need different access. A process can hold a file in a way that permits reading and blocks renaming, so the two failures are not interchangeable.

The file is in use by "System". What now?

That usually means a network share, a mounted image, or a driver. Disconnect the share or eject the image. If neither applies, a restart is the practical answer.

Can I force-delete a locked file?

Not safely while something has it open — the lock exists to stop two things writing at once. Find the holder instead. The exception is a leftover from software that crashed, which a restart clears.

Does this affect deleting duplicates?

Yes, and it is a common snag when clearing a large batch. There is a safe order of operations in finding and deleting duplicate files.

Was this useful?

Quick File Organizer

Folders that organize themselves, by your rules. Free, no account.

See Quick File Organizer

Keep reading

Know when the next app ships

1 more Windows utility is in development. One short email when each one is ready — nothing else.

Product releases only — roughly once a month. Unsubscribe any time.