You might want to put some timers in the following script so the commands don't overrun each other.
net stop wuauserv
del c:\windows\SoftwareDistribution\EventCache.v2 /q /s
net start wuauserv
set it as a scheduled task that runs every quarter or bi-annually.
source:
Windows\SoftwareDistribution Folder Cleanup Automation
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/f5744a18-d4ca-4631-8324-878b9225251d/windowssoftwaredistribution-folder-cleanup-automation?forum=winserverwsus
-------------------------------------------------------------------------------------
If the Answer is helpful, please click "Accept Answer" and upvote it.
Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.