Copy and paste this into notepad. Name it fix.bat to desktop. right click and run as admin. it rakes a while so be patient.
When done reboot computer and run windows update again. Also make sure you have your security software disabled.
rem USE AT OWN RISK AS IS WITHOUT WARRANTY OF ANY KIND !!!!!
rem FixWin -
You are being redirected...
rem Windows Repair Toolbox -
Windows Repair Toolbox - (Almost) everything you need to repair Windows problems in one small handy tool.
rem Windows Update Agent Reset -
Script Reset Windows Update Agent
rem Windows Update Troubleshooter -
https://support.microsoft.com/en-us...68-021e32467565/windows-update-troubleshooter
rem
Chkdsk
rem
Redesigning chkdsk and the new NTFS health model
rem To repair bad sectors run
rem chkdsk %SystemDrive% /r
rem To fix Windows corrupted files include
rem sfc /scannow
rem To edit Registry (if you can not boot into Windows)
rem Boot Windows USB - Repair - Troubleshoot - CMD - type/enter
rem c:
rem cd windows
rem cmd
rem regedit
rem Select HKLM (or required key)
rem File - Load Hive - %WinDir%\System32\Config (select required Hive, like System/HKLM)
rem SAVE - Unload Hive (when you finish editing)
reg add "HKCU\Control Panel\International" /v "sDecimal" /t REG_SZ /d "." /f
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /f
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" /f
reg delete "HKCU\Software\Microsoft\WindowsSelfHost" /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate" /f
reg delete "HKLM\Software\Microsoft\WindowsSelfHost" /f
reg delete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /f
reg delete "HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f
rem To restart explorer
taskkill /im explorer.exe /f & explorer.exe
sc config bits start= disabled
sc config cryptSvc start= disabled
sc config msiserver start= disabled
sc config UsoSvc start= disabled
sc config winmgmt start= disabled
sc config wuauserv start= disabled
taskkill /im TiWorker.exe /f
net stop bits /y
net stop cryptSvc /y
net stop msiserver /y
net stop UsoSvc /y
net stop winmgmt /y
winmgmt /salvagerepository
taskkill /im TiWorker.exe /f
net stop wuauserv /y
takeown /f "%WINDIR%\winsxs\pending.xml" /a
icacls "%WINDIR%\winsxs\pending.xml" /grant:r Administrators:F /c
del "%WINDIR%\winsxs\pending.xml" /s /f /q
del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat" /s /f /q
del "%ALLUSERSPROFILE%\Microsoft\Network\Downloader\qmgr*.dat" /s /f /q
del "%LocalAppData%\Microsoft\Windows\INetCache" /s /f /q
del "%LocalAppData%\Microsoft\Windows\WebCache" /s /f /q
del "%temp%" /s /f /q
del "%WINDIR%\Logs" /s /f /q
del "%WINDIR%\Installer\$PatchCache$" /s /f /q
del "%WINDIR%\SoftwareDistribution" /s /f /q
del "%WINDIR%\System32\winevt\Logs" /s /f /q
del "%WINDIR%\Temp" /s /f /q
del "%WINDIR%\WinSxS\Backup" /s /f /q
rem Optional (you have to stop cryptSvc), it might take a while, till Catroot2's Folder is recreated (about an hour)
rem takeown /f "%WINDIR%\System32\catroot2" /a
rem icacls "%WINDIR%\System32\catroot2" /grant:r Administrators:F /c
rem del "%WINDIR%\System32\catroot2" /s /f /q
reg add "HKLM\System\CurrentControlSet\Services\BFE" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\MpsSvc" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\SystemEventsBroker" /v "Start" /t REG_DWORD /d "2" /f
reg add "HKLM\System\CurrentControlSet\Services\WinHttpAutoProxySvc" /v "Start" /t REG_DWORD /d "3" /f
sc config Appinfo start= auto
sc config bits start= demand
sc config cryptSvc start= auto
sc config Dhcp start= auto
sc config DiagTrack start= auto
sc config diagnosticshub.standardcollector.service start= demand
sc config DPS start= auto
sc config EventLog start= auto
sc config EventSystem start= auto
sc config lmhosts start= auto
sc config KeyIso start= auto
sc config Netman start= demand
sc config NcbService start= demand
sc config netprofm start= auto
sc config NlaSvc start= auto
sc config nsi start= auto
sc config RmSvc start= auto
sc config SystemEventsBroker start= auto
sc config TokenBroker start= auto
sc config TrkWks start= auto
sc config UsoSvc start= demand
sc config WdiServiceHost start= demand
sc config wisvc start= demand
sc config winmgmt start= demand
sc config Wcmsvc start= auto
sc config WdiServiceHost start= demand
sc config WlanSvc start= auto
sc config wuauserv start= auto
sc config WwanSvc start= demand
fsutil usn deletejournal /d /n c:
chkdsk /scan
ipconfig /flushdns
vssadmin delete shadows /for=c: /all /quiet
Dism /Online /Cleanup-Image /RestoreHealth
Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase
cleanmgr /sageset:65535 & cleanmgr /sagerun:65535
start "" "
CCleaner - Builds"
start "" "
Wise Care 365 - Stabilize, Secure and Speed Up Your Windows PC with One Click!"