Clear Your Windows Update Cache

Clear Your Windows Update Cache

Windows updates have gained a reputation for being a bit temperamental at times, whether you are using Windows 10 or Windows 11. Although Microsoft made a lot of improvements to the Windows update processes, there can sometimes be issues with the Windows update service.

Windows update keeps a cache of files. This cache stores downloaded update files, and sometimes it can become cluttered, leading to various issues like:

  • Update stuck or fails: Corrupted data in the cache can prevent updates from downloading or installing correctly.
  • Limited disk space: The cache can accumulate and occupy considerable disk space, especially on devices with limited storage.
  • Performance slowdown: A bloated cache can put a strain on your system resources, potentially causing sluggishness.

Therefore, knowing how to clear the Windows Update cache is crucial for maintaining optimal system health. Here are two simple methods you can use:

Method 1: Using Disk Cleanup (Recommended for Beginners)

  1. Open the Start menu and search for “Disk Cleanup“.
  2. Select the drive where Windows is installed (usually C:) and click “OK.”
  3. Click “Clean up system files” to access more options.
  4. Check the boxes for “Windows Update cleanup” and “Temporary Windows installation files.”
  5. Click “OK” and wait for the cleanup to complete. This may take a few minutes.

Method 2: PowerShell Script (Convenient for Frequent Cleaning)

  1. Create a new PowerShell script (e.g., CleanUpdateCache.ps1):
Stop-Service wuauserv -ErrorAction SilentlyContinue
Stop-Service bits -ErrorAction SilentlyContinue
Stop-Service cryptsvc -ErrorAction SilentlyContinue
Stop-Service msiserver -ErrorAction SilentlyContinue

Remove-Item -Path "C:\Windows\SoftwareDistribution\Download" -Force -Recurse -ErrorAction SilentlyContinue

Start-Service wuauserv -ErrorAction SilentlyContinue
Start-Service bits -ErrorAction SilentlyContinue
Start-Service cryptsvc -ErrorAction SilentlyContinue
Start-Service msiserver -ErrorAction SilentlyContinue

Write-Host "Windows Update cache successfully cleared!"
  1. Save the script and run it with administrator privileges:
    • Right-click the script file and select “Run as administrator.”
    • Enter your administrator password when prompted.
  1. The script will automatically stop relevant services, delete cache files, and restart the services.

Method 2: One-Time Command (For Specific Situations)

  1. Open PowerShell as administrator:
    • Press Windows + X and select “Windows PowerShell (Admin).”
  2. Execute the following command:
Stop-Service wuauserv -ErrorAction SilentlyContinue; Remove-Item -Path "C:\Windows\SoftwareDistribution\Download" -Force -Recurse -ErrorAction SilentlyContinue; Start-Service wuauserv -ErrorAction SilentlyContinue
  1. Press Enter. The command will perform the same actions as the script.

Important Notes:

  • Always back up important data before making system changes.
  • Restart your computer after clearing the cache for changes to take effect.
  • Use the single command only if you understand PowerShell. Incorrect commands can cause problems.
  • Clearing the cache doesn’t affect installed updates or system settings.