Clear the Windows update cache: via cmd, Notepad

Clear the Windows update cache: via cmd, Notepad

The Update Cache is a special folder that stores update installation files. Continue reading to discover how to purge the Windows Update Cache.

There are several reasons why you would want to purge the Windows Update cache. Doing so will allow you to instantly reclaim valuable storage space by deleting obsolete update installation files. (This maintenance routine is usually managed by Windows, but you may also do it manually.) You may also wish to purge the update cache if you're experiencing installation errors. Deleting and re-downloading corrupt update installation files may solve your issue. 

How to manually purge the Update cache?

First, you need to temporarily turn off the Windows Update service (to stop background downloads). Open the Command Prompt, type the:

net stop wuauserv

command, and press Enter.

Open File Explorer, and go to View > Folder Options. Select the Show hidden files, folder, and drives radio button, and click Apply to enable the display of hidden files on your computer.

Once done, navigate to C:\Windows\SoftwareDistribution\Download and delete the content of the Download folder.

Open a new Command prompt window, and run the:

net start wuauserv

command to restart the Windows Update service. 

How to purge the Update cache with a batch file?

You can create a batch file and use it as a shortcut to instantly clear the content of the Windows Update cache.

Open Notepad, and copy/paste the following code:

net stop wuauserv  
CD %Windir%          
CD SoftwareDistribution          
DEL /F /S /Q Download
net start wuauserv

Click File > Save As, and choose a location to save the file. Click the Save as type drop-down menu, and select All Files. Rename the file Erase_Cache.bat, and click Save.

Newsletter

Your batch file is now ready for use. Right-click the Erase_Cache.bat file, then click Run As Administrator. In doing so, you will automatically delete the content of the Update cache folder.