ContextCleaner: see every entry in the Windows 11 right-click menu, and which app added it — on the Microsoft Store.
Engineering LockGhost

"The Process Cannot Access the File Because It Is Being Used by Another Process": Error 32 Explained

Published October 19, 2026 Updated October 19, 2026 8 min read

“The process cannot access the file because it is being used by another process” is Windows system error 32, named ERROR_SHARING_VIOLATION. It means another program has the file open in a way that does not allow what you are trying to do, such as delete, rename, move or overwrite it. The fix is to find that program and close the file, or close the program. Windows rarely tells you which program it is. LockGhost from Automata Labs does: paste, drag or right-click a path and it lists every process holding it by friendly name, using the Windows Restart Manager API, so you can close the right one.

See which process is holding your file, by name, and release it safely.

Get it from Microsoft

What does error 32 mean?

Microsoft’s list of system error codes defines it:

CodeNameMessage
32 (0x20)ERROR_SHARING_VIOLATIONThe process cannot access the file because it is being used by another process.
33 (0x21)ERROR_LOCK_VIOLATIONThe process cannot access the file because another process has locked a portion of the file.

You may see the same error in other forms:

  • 0x80070020 is error 32 wrapped as an HRESULT. Windows APIs that return HRESULTs map system error codes with HRESULT_FROM_WIN32, and 32 becomes 0x80070020. It shows up in Windows Update, installers and some backup tools.
  • “The action can’t be completed because the file is open in another program” is File Explorer’s friendlier wording of the same situation.
  • An IOException in PowerShell, .NET apps and build tools, with the same “being used by another process” message.

Error 33 is a close cousin. It means another process has locked part of the file, often a database or a document that supports shared editing.

Why does Windows block the file?

When a program opens a file, it tells Windows what it will allow other programs to do with that file at the same time. Microsoft’s CreateFile documentation explains the share mode: if a program opens a file with a share mode of zero, “the file or device cannot be shared and cannot be opened again until the handle to the file or device is closed.” If you then request access that conflicts with the existing open handle, “CreateFile would fail and the GetLastError function would return ERROR_SHARING_VIOLATION.”

In plain terms: the first program got there first and said “nobody else touches this.” Until it closes the file, Windows enforces that.

Common culprits:

  • The app you used last. Word, Excel, a PDF reader or a video player still has the file open.
  • Explorer itself, for example while generating a thumbnail or showing a preview pane.
  • Sync clients such as OneDrive, uploading or scanning the file.
  • Antivirus, scanning a new or changed file.
  • Search indexing, reading the file’s contents.
  • Developer tools, such as a dev server, file watcher, terminal or IDE holding a folder open.
  • A process that crashed or hung without closing its handles.

How do I fix “being used by another process”?

Work through these in order, from least to most disruptive:

  1. Close the file in the app you used. Save and close the document, not just the window.
  2. Wait a moment and retry. Antivirus scans and sync uploads often finish within seconds.
  3. Turn off Explorer’s preview pane if the file is selected in a folder with preview on.
  4. Pause sync for the folder, then retry.
  5. Find the process holding it. Use LockGhost, or Resource Monitor’s Associated Handles search (run resmon, open the CPU tab and search for the file name).
  6. Close that program normally. Only end the process if it is not responding and you know what it is.
  7. Sign out or restart if nothing else works. That closes every handle.

How do I find which process is using the file?

Windows has the information, it just does not show it in the error. The Restart Manager is the part of Windows that installers use to find out which applications and services are using files they need to update. Microsoft’s documentation explains that the primary reason updates require a restart is “that some of the files that are being updated are currently being used by a running application or service.”

LockGhost puts that same mechanism behind a simple window. According to its product page and Microsoft Store listing:

  • Restart Manager based. Locks are resolved through the official Windows Restart Manager API and translated into readable process names.
  • One field, three ways in. Paste a path, drag a file or folder in, or right-click it in Explorer.
  • Friendly names instead of process IDs, with color-coded severity so system processes stand out.
  • Guarded End Process. One-click End Process ships with safeguards to reduce the chance of ending a critical system process by mistake.
  • Local lock history stored on your PC.
  • Offline, with no cloud account and no telemetry.

Paste the path from the error message and see who is holding it.

Get it from Microsoft

LockGhost vs the built-in options

Error messageResource MonitorLockGhost
Names the processSometimes, usually notYesYes, friendly names
Works from Explorer right-clickNoNoYes
Shows severity of the processNoNoColor-coded
Ending a processNoYes, no guardrailsGuarded End Process
History of past locksNoNoLocal history
Built inYesYesOne-time purchase

For a wider comparison, including Microsoft’s own PowerToys tool, see PowerToys File Locksmith vs LockGhost and our guide to the Restart Manager way to find a file lock.

Where does error 32 show up most often?

Where you see itUsual causeWhere to look
Deleting a file in ExplorerThe app you opened it inCannot delete a file in use
Saving an Excel workbookAnother Excel instance, a preview or a sync clientExcel file in use, cannot save
Git checkout, pull or cleanAn editor, terminal or dev serverGit cannot delete a file used by another process
OneDrive foldersOneDrive syncing the fileOneDrive file in use
Build tools and scriptsA file watcher or a previous build still runningYour terminal sessions and background tasks
Windows Update and installers, as 0x80070020A running app or serviceClose apps, retry, then restart

How do I avoid error 32 in my own scripts?

If you write scripts or code that open files, a few habits prevent most sharing violations:

  1. Close files as soon as you are done. In PowerShell and .NET, dispose of streams, for example with a using block.
  2. Open with a compatible share mode when other programs need to read the file at the same time.
  3. Retry with a short delay when you hit error 32 on a file that antivirus or sync might be touching.
  4. Do not keep a terminal sitting inside a folder you are about to delete. The shell’s working directory holds the folder open.
  5. Stop watchers before cleanup. Dev servers and file watchers often hold handles on folders.

Frequently asked questions

What is error code 32 in Windows?

It is ERROR_SHARING_VIOLATION: “The process cannot access the file because it is being used by another process.” Another program has the file open in a way that blocks your action.

What is error 0x80070020?

It is error 32 in HRESULT form. You will see it in Windows Update, installers and other tools that report HRESULT codes.

Is error 32 the same as access denied?

No. Access denied is error 5, which is about permissions. Error 32 is about another program using the file right now.

Will restarting fix “being used by another process”?

Usually, because a restart closes every open handle. Finding and closing the right program is faster and does not lose your other work.

Is it safe to end the process holding a file?

Closing the program normally is safest. Ending a process can lose unsaved work, and ending a system process can make Windows unstable. LockGhost’s severity colors and End Process safeguards help you avoid the risky ones.

Try LockGhost

Get LockGhost from the Microsoft Store. It is a one-time purchase, and the Store listing shows the current price.

Turn “used by another process” into a name you can act on.

Get it from Microsoft

Microsoft, Windows, Excel, Word, OneDrive and PowerToys are trademarks of the Microsoft group of companies. Git is a trademark of Software Freedom Conservancy. LockGhost is not affiliated with or endorsed by them.

Last updated 19 October 2026. Published by Automata Labs, a software company in Canada.

// release_radar

Get notified about new releases.

We build native, local-first tools for professionals who refuse SaaS fatigue. Drop your email to hear about new apps, major updates, and zero-telemetry releases as they land on the Microsoft Store. No spam — just release news.