Windows could not search for new updates Error Code 80245003 fix

This little script will fix the Windows could not search for new updates Error Code 80245003 error message. It also serves another purpose. Whenever I create a new image, I want to eliminate as much clutter as possible for the smallest possible image. Sometimes the SoftwareDistribution folder can contain 100s of megabytes of files that are unneeded for an image. These files will recreate themselves as soon as windows update services are re-enabled.

I wrote this script using AutoIT to clean out the SoftwareDistrution and Prefetch folders.

; Clean out the Software Distribution
RunWait (@ComSpec & " /c " & "net stop wuauserv","", @SW_HIDE)
DirRemove (@WindowsDir & "\SoftwareDistribution", 1)
Sleep(5000)
RunWait (@ComSpec & " /c " & "net start wuauserv","", @SW_HIDE)

; Clean out Prefetch
FileDelete (@WindowsDir & "\Prefetch\*.*")