How do I clear the local Windows Update cache with WuInstall?
The /clearlocalcache switch (/clear_localcache in the built-in help; both spellings work) removes all files from the local Windows Update download cache:
wuinstall /clearlocalcache
WuInstall stops the BITS and Windows Update services, deletes everything in %SystemRoot%\SoftwareDistribution\Download and starts the services again, forcing Windows Update to download all pending updates fresh on the next run. This requires administrator rights. On Windows XP and Windows Server 2003 (WuInstall 2.9.x), WuInstall deletes everything in %SystemRoot%\SoftwareDistribution.
When to use it:
- Updates fail repeatedly with download or corruption errors
- You want to free disk space consumed by old cached updates
- You suspect a partially downloaded update is causing installation failures
After clearing the cache, install the updates again:
wuinstall /install /autoaccepteula
If updates that previously failed now install successfully, the corrupted cache was the problem.
Differences between the versions:
- WuInstall 3 deletes every file that is not in use. WuInstall 2.9.x stops at the first file it cannot delete.
- WuInstall 3 also stops the services that depend on BITS or Windows Update. From 3.0.2 on it starts them again afterwards; 3.0.0 and 3.0.1 leave them stopped until the next restart. WuInstall 2.9.x does not stop BITS or Windows Update at all while a service that depends on them is running.
- The abbreviation
/clearruns this switch in WuInstall 3; WuInstall 2.9.x rejects it with exit code7.
Note: This operation only affects the local machine's download cache. It does not touch the shared network cache used by
/install_cacheor/download_cache.