Windows Update Errors

0x80070020 File In Use: Stopping the Lock Without a Reboot Loop

If you keep seeing “0x80070020 – The process cannot access the file because it is being used by another process” during Windows Update, backups, app installs, or system tasks, you’re dealing with a sharing violation: Windows needs a file, but another program or service is holding it open. Left unresolved, this can create a frustrating update failure or “try again after restart” loop. This guide goes beyond generic advice with concrete, step-by-step methods to identify what’s locking the file and stop it—without living in a reboot loop.

You’ll learn how to find the culprit process, safely release the lock, repair Windows Update components, and validate that your system is stable afterward.

Understanding the Error

What 0x80070020 means (plain language)

  • Error code 0x80070020 maps to ERROR_SHARING_VIOLATION. In plain terms: Windows tried to read or write a file, but another process already has it open in a way that prevents sharing.
  • You’ll often see it reported during Windows Update (e.g., “Windows Update error 0x80070020”), Microsoft Store updates, antivirus definition updates, backups, or when running system tools. The message commonly reads: “The process cannot access the file because it is being used by another process.”

Typical scenarios that trigger it

  • A real-time antivirus engine (or other security/backup software) holds a file open in Windows’ update cache (SoftwareDistribution) or catalog (Catroot2).
  • Cloud sync (OneDrive/Dropbox), indexing (Windows Search), or third-party file-monitoring tools scan or alter a file at the same moment Windows needs it.
  • File system corruption, bad sectors, or disk-timeout issues cause retries that collide with other processes.
  • Orphaned update components, partial downloads, and stuck services keep files in use after a failed update.
  • Third-party filter drivers (backup, encryption, storage acceleration) force locks on certain files or volumes.
  • Rarely, malware injects or locks files to block updates.

Why it’s critical to fix

  • Update failure loops can leave your system behind on security patches.
  • Repeated sharing violations suggest software conflicts or file system issues that can cause broader instability.
  • Fixing the root cause avoids endless “restart and retry” cycles.

Quick Reference Table

Cause Symptom Recommended Fix
Antivirus/Antimalware real-time scan Windows Update fails with 0x80070020; high AV activity Temporarily disable real-time scanning; exclude update folders; retry update
Cloud sync (OneDrive/Dropbox) “File in use” during update or backup; sync icon active Pause syncing; close the app; retry; resume after success
Windows Search indexer Files in SoftwareDistribution/Catroot2 appear busy Stop Windows Search service; retry; re-enable after
Backup/imaging/VSS tools Backups fail with 0x80070020; VSS writer warnings in logs Stop backup services; check VSS writers; retry
Stuck Windows Update services Update loop; partial downloads; SoftwareDistribution locked Stop BITS/WUAUSERV/etc., rename SoftwareDistribution/Catroot2, restart services
Third-party filter drivers Consistent sharing violations during system updates Update or temporarily uninstall the software (backup, encryption, storage filters)
File system corruption/disk issues SFC/DISM errors; Event Viewer disk warnings Run CHKDSK, SFC, DISM; check SMART; fix/replace failing drive
Malware or unwanted injectors Update fails; odd processes holding handles Run full offline scan; remove malware before retrying updates
Pending reboot requirement Update requests reboot repeatedly; files remain locked after restart Clear update cache; ensure services stop; close locking apps; avoid rebooting until lock is released
Microsoft Store/WSReset needed Store app updates fail with 0x80070020 Run WSReset; repair/reset the Store; clear app caches

Common Causes

  • Real-time security tools: Antivirus/EDR/anti-ransomware software scanning update files or system DLLs, causing a sharing violation.
  • Cloud storage and sync engines: OneDrive, Dropbox, Google Drive, Box Drive, and similar utilities scanning, deduplicating, or syncing files during updates.
  • Indexers and content services: Windows Search indexer and third-party desktop search.
  • Backup/imaging or versioning: Acronis, Macrium, CrashPlan, Veeam agents, file history, or other tools that hook file I/O or VSS.
  • Windows Update components: Stuck BITS or Windows Update services, partial downloads in SoftwareDistribution, or corrupted Catroot2.
  • Third-party filter drivers: Encryption, compression, DLP, or storage acceleration drivers intercepting file access.
  • Disk/file system issues: Corruption, bad sectors, or failing SSD/HDD leading to retries and collisions.
  • Malware: Malicious software intentionally locking files or injecting into system processes.
  • Permissions/policy constraints: Enterprise policies or permissions blocking access to system locations.
See also  0x8024001E WU_E_SERVICE_STOP: Keeping Services Alive to Finish

Preliminary Checks

  • Boot to Safe Mode (Windows 10/11)

    1. Press Windows key + I > System > Recovery.
    2. Under Advanced startup, click Restart now.
    3. Troubleshoot > Advanced options > Startup Settings > Restart.
    4. Press 4 for Enable Safe Mode or 5 for Safe Mode with Networking.
      Safe Mode minimizes third-party drivers/services, often eliminating the lock. If updates or fixes succeed here, a third-party service likely caused the lock.
  • Back up important data

    • Copy critical documents to an external drive or cloud.
    • Create a restore point: press Windows key, type “Create a restore point” > Select your system drive > Create.
  • Run basic health checks

    • System file check:

      sfc /scannow

    • Windows component health repair:

      DISM /Online /Cleanup-Image /RestoreHealth

    • Quick disk scan (non-destructive):

      chkdsk C: /scan

    If CHKDSK reports errors requiring a fix, schedule a repair:

    chkdsk C: /f

    Note: /f requires a reboot. This is not a “reboot loop” fix, but a one-off repair may be necessary if corruption exists.

Step-by-Step Troubleshooting

Follow these in order. Stop when your issue is resolved.

  1. Pause antivirus and exclude update folders
  • Temporarily disable real-time scanning (do not uninstall). If using Windows Security:
    • Windows Security > Virus & threat protection > Manage settings > toggle Real-time protection Off (temporarily).
  • Add exclusions to reduce future conflicts:
    • Exclude these folders:
      • C:\Windows\SoftwareDistribution
      • C:\Windows\System32\catroot2
  • Retry the update/install. Re-enable protection after.
  1. Pause cloud sync and indexing
  • Pause OneDrive: click the OneDrive cloud icon > Pause syncing (2 hours).

  • Exit Dropbox/Google Drive clients.

  • Temporarily stop Windows Search service:

    net stop wsearch

  • Retry the update.

  1. Find and close the exact locking process (no reboot)
    Use built-in and Sysinternals tools to locate the handle locking the file.
  • Resource Monitor:

    • Press Windows key, type “resmon” and press Enter.
    • CPU tab > Associated Handles > search a keyword from the path (e.g., “SoftwareDistribution”).
  • Process Explorer (Sysinternals, Microsoft):

    • Download and run as Administrator.
    • Press Ctrl+F and search for a filename or folder (e.g., “catroot2” or the specific file path shown in logs).
    • Right-click the handle > Close Handle (use caution; closing a handle can crash the owning process and cause data loss—prefer to exit the app cleanly first).
  • handle.exe (Sysinternals):

    • Open elevated Command Prompt in the folder where handle.exe resides:

      handle.exe SoftwareDistribution

    • Note the PID and handle ID, then close cautiously:

      handle.exe -c -p -y

    After you release the lock, retry the update without rebooting.

  1. Clean boot to eliminate third-party conflicts
  • Press Windows key + R, type:

    msconfig

  • On Services tab: check “Hide all Microsoft services,” then click “Disable all.”

  • On Startup tab: open Task Manager and disable startup items.

  • Click OK and restart (one reboot). Try the update now. If it works, re-enable services in batches to find the culprit.

  1. Reset Windows Update components (safe and reliable)
    Run these commands in an elevated Command Prompt (Administrator). They stop services, clear caches, and restart cleanly:

Stop services:

net stop bits
net stop wuauserv
net stop appidsvc
net stop cryptsvc

Rename (back up) the update cache folders:

ren %systemroot%\SoftwareDistribution SoftwareDistribution.old
ren %systemroot%\System32\catroot2 Catroot2.old

Optionally clear Delivery Optimization cache:

del /s /q %systemroot%\SoftwareDistribution\DeliveryOptimization\Cache*.*

Restart services:

net start cryptsvc
net start appidsvc
net start wuauserv
net start bits

Retry Windows Update:

  • Windows 10/11 Settings > Windows Update > Check for updates.
  1. Fix Microsoft Store updates showing 0x80070020
  • Reset the Store cache:

    WSReset.exe

  • Repair/Reset Microsoft Store:

    • Settings > Apps > Installed apps > Microsoft Store > Advanced options > Repair (then Reset if needed).
  1. Check Volume Shadow Copy Service (VSS) for backup-related 0x80070020
  • List writer status:

    vssadmin list writers

    • If writers show errors, restart related services (e.g., SQL Server, Hyper-V) and VSS:

      net stop vss
      net start vss

  • Temporarily pause or stop third-party backup services, then retry your operation.

  1. Repair system files and component store again (after conflicts are cleared)
  • Run:

    sfc /scannow
    DISM /Online /Cleanup-Image /RestoreHealth

  • Retry Windows Update or your failing task.

  1. Inspect Event Viewer and Windows Update logs for locked file paths
  • Open Event Viewer (eventvwr.msc).

  • Check:

    • Applications and Services Logs > Microsoft > Windows > WindowsUpdateClient > Operational
    • Windows Logs > System and Application
  • Extract WindowsUpdate.log (Windows 10/11):

    Get-WindowsUpdateLog

    Review the generated log on your Desktop for file paths and error 0x80070020 entries. Use those paths with Process Explorer’s Find Handle to pinpoint the locking process.

  1. Update or remove conflicting drivers/software
  • Update storage drivers (Intel RST, AMD RAID), NVMe drivers, and chipset drivers from the OEM site.
  • Update or temporarily uninstall:
    • Old backup/imaging tools
    • Legacy encryption/compression software
    • Outdated antivirus or security suites (use vendor removal tools)
  • Reboot once, then retry updates.
  1. Network/service refresh (if you also suspect network or service state issues)
    These don’t directly solve sharing violations but help if services are stuck:
See also  0x80246007 BITS Transfer Issues: Health Checks and Reset

net stop wuauserv
net stop bits
netsh winsock reset
netsh int ip reset
net start bits
net start wuauserv

  1. In-place repair upgrade (last resort for persistent corruption)
  • Download the Windows 10/11 Media Creation Tool or Windows 11 ISO.
  • Run setup.exe from within Windows and choose Keep personal files and apps.
  • This refreshes Windows components without wiping your data and usually resolves stubborn update and sharing-violation loops.

Minidump analysis (only if you also see BSODs during updates)
While 0x80070020 itself is a sharing violation and not a classic BSOD stop code, some systems crash during update attempts. If you encounter blue screens alongside update failures:

  • Ensure minidumps are enabled:

    • Control Panel > System > Advanced system settings > Startup and Recovery > Settings
    • Under Write debugging information: select Small memory dump (256 KB).
    • Dumps are stored in C:\Windows\Minidump.
  • Tools to identify problematic drivers/modules:

    • BlueScreenView: Quick, user-friendly overview of suspected drivers.

    • WinDbg (Microsoft Store: WinDbg Preview):

      1. File > Open dump file > select latest .dmp in C:\Windows\Minidump

      2. Run:

        !analyze -v
        lm

      3. Look for third-party drivers (e.g., backup filter, AV driver) that crash during update. Update or remove them and retry updates.

  • If BSODs implicate filter drivers or storage drivers, update or uninstall them; then repeat Windows Update steps above.

Advanced Diagnostics

Use with care; these tools are powerful.

  • Driver Verifier (to catch misbehaving third-party drivers)

    • Open elevated Command Prompt:

      verifier

    • Choose Create standard settings > Select driver names from a list > Check only non-Microsoft drivers you suspect (backup, AV, storage).

    • Reboot and use the system; if a bad driver is present, you may get a BSOD pointing to it.

    • Disable Verifier after testing:

      verifier /reset

    Caution: Driver Verifier can cause intentional stress/BSODs. Use on a stable system and ensure you can boot into Safe Mode to disable it if needed.

  • Process Monitor (ProcMon) to catch SHARING VIOLATION in real time

    • Run ProcMon as Administrator (Sysinternals).
    • Filter > Filter… > Add Condition: Result is SHARING VIOLATION, then Include.
    • Reproduce the update/backup action.
    • Inspect which process is hitting the locked file paths, then pause/close that app or stop its service.
  • Event Viewer correlation

    • Look for:
      • WindowsUpdateClient events with 0x80070020
      • Service Control Manager warnings/errors around the same time
      • Disk/NTFS warnings (Event IDs 55, 7, 153) indicating storage issues
    • If disk-related events occur, prioritize CHKDSK, SFC/DISM, and hardware diagnostics.
  • Storage health

    • Check SMART with your drive manufacturer’s tool or:

      • PowerShell:

        Get-PhysicalDisk | Get-StorageReliabilityCounter

      • Look for reallocated sectors, pending sectors, or media errors, then consider replacing the drive.

Post-Fix Checklist

  • Confirm updates complete successfully:

    • Settings > Windows Update > Check for updates.
    • Ensure no new 0x80070020 appears.
  • Review Event Viewer:

    • No new 0x80070020 or SHARING VIOLATION spikes during update times.
  • Run SFC and DISM again to confirm integrity:

    sfc /scannow
    DISM /Online /Cleanup-Image /RestoreHealth

  • Validate disk health:

    chkdsk C: /scan

  • Reliability Monitor:

    • Press Windows key, type “Reliability Monitor.”
    • Ensure the Stability Index is improving and no repeat failures are logged.
  • Re-enable any services or startup items you disabled (antivirus, OneDrive, backups), then watch for any recurrence when they are active. If the issue returns, fine-tune exclusions or update/uninstall the offending software.

See also  0xC1900208 Incompatible Apps Blocking the Upgrade: Find and Remove

When to Seek Professional Help

  • Persistent sharing violations even in Safe Mode or Clean Boot.
  • Repeated file corruption, CHKDSK errors, or SMART warnings indicating drive failure.
  • BSODs implicating core storage drivers or third-party filters you cannot safely remove.
  • Corporate endpoints where EDR/DLP policies are enforced by IT—contact your administrator.
  • You need data recovery or hardware diagnostics beyond basic checks.

Prevention Tips

  • Practice driver hygiene:

    • Keep chipset, storage (Intel RST/AMD/NVMe), and GPU drivers up-to-date from the OEM.
    • Uninstall old backup/encryption tools you no longer use.
  • Configure security tools thoughtfully:

    • Avoid running multiple real-time antivirus engines simultaneously.
    • Add exclusions for:
      • C:\Windows\SoftwareDistribution
      • C:\Windows\System32\Catroot2
    • Keep antivirus and EDR agents updated.
  • Schedule heavy background tasks:

    • Run backups, cloud sync “catch-ups,” and indexing at times outside update windows.
    • Pause OneDrive/Dropbox during major updates.
  • Maintain system health:

    • Run SFC/DISM when you suspect corruption.
    • Monitor disk health; replace aging drives proactively.
    • Keep Windows current to receive reliability fixes.
  • Backups and restore readiness:

    • Regularly back up important data.
    • Create restore points before major updates or software changes.

Conclusion

Error 0x80070020 (ERROR_SHARING_VIOLATION) means “file in use,” and it most often appears when antivirus, sync, backup, or indexing tools collide with Windows Update or system maintenance. You can stop the lock—and the reboot loop—by identifying the holding process, pausing or excluding it, and resetting Windows Update components. If necessary, repair system files with SFC/DISM, check disk health, and update or remove problematic filter drivers. With the steps in this guide, most systems can return to reliable updates without endless restarts.

FAQ

What causes Windows Update error 0x80070020 most often?

Typically real-time antivirus or backup/sync software locking update files in SoftwareDistribution or Catroot2. Indexers and third-party filter drivers are also common causes.

Do I have to reboot to fix a sharing violation?

Not always. You can stop services, pause antivirus/sync tools, and close the specific handle (using Process Explorer or handle.exe) to release the lock without rebooting. A single reboot may still be needed if system files or drivers are involved, but it shouldn’t become a loop once the root cause is addressed.

Is it safe to delete or rename SoftwareDistribution and Catroot2?

Yes, when done correctly. Stop update-related services first, then rename these folders. Windows recreates them. Use:

net stop bits
net stop wuauserv
net stop appidsvc
net stop cryptsvc
ren %systemroot%\SoftwareDistribution SoftwareDistribution.old
ren %systemroot%\System32\catroot2 Catroot2.old
net start cryptsvc
net start appidsvc
net start wuauserv
net start bits

How do I find which process is locking a file?

Use Resource Monitor (resmon) or Sysinternals tools:

  • Process Explorer > Ctrl+F > search for the filename/path.

  • handle.exe:

    handle.exe

Then close the app or stop the service holding the handle. Closing handles forcibly should be a last resort.

Will an in-place upgrade repair fix 0x80070020?

If the root cause is system corruption or damaged update components, an in-place repair upgrade can help. It refreshes Windows while keeping your files and apps. If a third-party tool is locking files, you’ll still need to update, reconfigure, or remove that tool to prevent recurrence.

You’ve got this. With a careful, step-by-step approach—locate the lock, release it safely, repair update components, and verify stability—you can eliminate 0x80070020 and get Windows updating smoothly again.

About the author

Jonathan Dudamel

Jonathan Dudamel

I'm Jonathan Dudamel, an experienced IT specialist and network engineer passionate about all things Windows. I have deep expertise in Microsoft project management, virtualization (VMware ESXi and Hyper-V), and Microsoft’s hybrid platform. I'm also skilled with Microsoft O365, Azure ADDS, and Windows Server environments from 2003 through 2022.

My strengths include Microsoft network infrastructure, VMware platforms, CMMS, ERP systems, and server administration (2016/2022).