Skip to content

Windows error inside an HRESULT

0x80070020 ERROR_SHARING_VIOLATION

The file is in use by another program, so it cannot be changed right now. Seen as 0x80070020.

Where you will see it

  • Windows Update
  • Installers
  • Backups

Likely causes, most common first

  • Antivirus scanning the file.
  • A program left running in the background.
  • A backup or sync tool holding the file.

How to fix it, in this order

Start with the first fix and check the result before moving on; each one says how to tell that it worked.

1. Restart, then try again before opening other programs (easy)

  1. Restart the PC.
  2. Run the update or install first, before starting other apps.
  3. If it still happens, pause third-party security software for one try.

It worked if: The step completes.

What Microsoft's documentation says

Microsoft's own wording for this code, quoted from the page named under each quote. The plain-English explanation and the fixes above are ours.

“The process cannot access the file because it is being used by another process.”
Listed as ERROR_SHARING_VIOLATION (32) in System Error Codes (0-499) on Microsoft Learn. Read 22 November 2026.
“Couldn't access the file because it is already in use. This can occur when the installer tries to replace a file that an antivirus, antimalware or backup program is currently scanning.”
Listed as InstallFileLocked in Windows Update error code list by component on Microsoft Learn. Read 22 November 2026.
“This error is caused by non-Microsoft filter drivers, such as antivirus.”
Listed as ERROR_SHARING_VIOLATION in Common Windows Update errors on Microsoft Learn. Read 22 November 2026.

Microsoft’s fix: retry after a clean boot; if it still fails, record the install with Process Monitor and match the file named in CBS.log to the program holding it.

The same code, written other ways

Search a log or a forum for any of these; they are all this code.

How the code is put together

Read from the bits as Microsoft's [MS-ERREF] Windows Error Codes specification lays them out.

Codes that often come with it

More than one code in your log?

Paste the whole CBS, DISM or Windows Update log into the decoder. It lists every code in it, in order, with the line it was on. Decoded in your browser; nothing is sent.

Open the error code decoder →