0x80070020

Windows Update Error 0x80070020: File Locked Fix

This error pops up when another program locks a file Windows Update needs. Here's how to find and kill that lock.

You're trying to run Windows Update, maybe installing the latest monthly patch or a driver update, and halfway through it throws 0x80070020. The update bar freezes, then fails. This happened to a client of mine last week on a Dell laptop running Windows 11 22H2 – they had a third-party antivirus scanning in the background. The error means a file that Windows Update needs is locked by another process. Could be your antivirus, a backup tool, or even a stuck Windows service.

What Actually Causes This Error

The error code 0x80070020 translates to ERROR_SHARING_VIOLATION – plain English: another program has the file open and won't let go. Windows Update downloads files to C:\Windows\SoftwareDistribution\Download. If something like Windows Defender real-time scanning, a third-party antivirus, or even an old update installer is using that file, the update fails. The trigger is almost always a background service or security tool that's too aggressive.

I've seen this most often after a system wakes from sleep or hibernate. The update service starts but some other service didn't release its lock properly. Also common after installing a new antivirus – it starts scanning everything mid-update.

Step-by-Step Fix

  1. Boot into Safe Mode with Networking. This bypasses most third-party services. Hold Shift while clicking Restart, then Troubleshoot > Advanced Options > Startup Settings > Restart, then press 5 for Safe Mode with Networking.
  2. Stop the Windows Update services. Open Command Prompt as Administrator (right-click Start, choose it). Run these commands one at a time:
    net stop wuauserv
    net stop cryptSvc
    net stop bits
    net stop msiserver
  3. Delete the temporary update folders. These folders hold the locked files. Run:
    ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
    ren C:\Windows\System32\catroot2 Catroot2.old

    This renames them, so Windows creates fresh ones on restart.

  4. Restart the services. Same Command Prompt:
    net start wuauserv
    net start cryptSvc
    net start bits
    net start msiserver
  5. Reboot normally and run Windows Update again.

If that doesn't fix it, the culprit is likely a third-party antivirus. Disable real-time protection temporarily. For Windows Defender, you can turn off real-time scanning in Virus & Threat Protection settings. For McAfee, Norton, or Bitdefender, open the app and pause protection for 10 minutes. Then try the update again.

Still Failing? Check These

  • Corrupt system files. Run sfc /scannow in Command Prompt as Admin. If it finds issues, run DISM /Online /Cleanup-Image /RestoreHealth.
  • Disk space low? Windows Update needs room to download and install. Check your free space in Settings > System > Storage. Aim for at least 10GB free.
  • Check the Windows Update log. Look at C:\Windows\WindowsUpdate.log for exact file paths that are locked. Search for "0x80070020" in that file to see which file caused the issue.

I've seen this error resolved by simply rebooting twice – once to clear locks, once to retry. But if the steps above don't work, the problem is usually a persistent service or driver locking the file. Use Process Explorer (free from Microsoft) to search for the file name mentioned in the log, then kill that process. Had a client once where a stuck OneDrive sync process was locking the update files – killed it, update ran fine.

Related Errors in Windows Errors
0X00000A40 Fix NERR_RplConfigNotFound 0X00000A40 in Windows 0XC00D0FD6 NS_E_PLUGIN_NOTSHUTDOWN (0XC00D0FD6) Fix – Windows Media Player Won’t Close 0X00000503 Fix ERROR_PARAMETER_QUOTA_EXCEEDED (0x503) on Windows 0XC00D2795 Fix NS_E_DRM_UNABLE_TO_CREATE_MIGRATION_IMPORTER_OBJECT (0XC00D2795)

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.