Windows Update [Win7]

https://www.wsus.de/de/Fehlercodes
https://docs.microsoft.com/de-ch/OfficeUpdates/index

Starte die Eingabeaufforderung (cmd.exe) als Administrator

  1. Windows Update und Intelligenter Hintergrundübertragungsdienst beenden
    net stop "Windows Update" & net stop bits

  2. Lösche Verzeichnis
    rmdir c:\Windows\SoftwareDistribution /S /Q

  3. Dienste wieder starten
    net start bits & net start "Windows Update"

  4. Windows Update starten
    wuauclt.exe /detectnow

Befehle
https://www.wsus.de/de/HowTo/Automatic-Updates-mit-Kommandozeilenoptionen

wuapp.exeÖffnet das Windows Update Fenster
wusa /? Windows Updates installieren oder deinstallieren
notepad %windir%\WindowsUpdate.logWindows Update Log
wuauclt /detectnowSuche nach MS Updates
wuauclt /reportnow
wuauclt.exe /r
Meldet einen Statusbericht an den WSUS Server
wuauclt /resetauthorization /detectnow
wuauclt.exe /a
Die Gruppenmitgliedschaft wird aktualisiert
wuauclt /ShowSettingsDialogZeigt den Einstellungsdialog „Automatische Updates“ an
wuauclt /DemoUIDas Symbol im Systray wird angezeigt
wuauclt /ShowWindowsUpdateÖffnet das Windows Update Fenster
wuauclt /CloseWindowsUpdateSchliesst das Windows Update Fenster
wuauclt /SelfUpdateManaged?
wuauclt /SelfUpdateUnmanaged?
wuauclt /UpdateNowStartet den Update Vorgang
net stop wuauservStoppt den Update Dienst
net start wuauservStartet den Update Dienst

Update Agent reparieren
http://support.microsoft.com/kb/927891
http://support.microsoft.com/ph/6527
https://support.microsoft.com/de-ch/help/4089834/windows-10-troubleshoot-problems-updating
https://docs.microsoft.com/en-us/windows/deployment/update/waas-manage-updates-wsus

Windows_Update.bat
@echo off
echo.
echo Achtung, das Script muss als Administrator ausgeführt werden.
echo.
set /p EINGABE=Wollen Sie fortfahren oder abbrechen? [j oder n] 
echo.
if not %EINGABE% == j goto ende
:start
net stop wuauserv
net stop appidsvc
net stop cryptSvc
net stop bits
net stop msiserver
 
del /s /q /f "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat"
del /s /q /f "%ALLUSERSPROFILE%\Microsoft\Network\Downloader\qmgr*.dat"
if exist "%SYSTEMROOT%\winsxs\pending.xml.bak" (
  del /s /q /f "%SYSTEMROOT%\winsxs\pending.xml.bak"
)
if exist "%SYSTEMROOT%\SoftwareDistribution.bak" (
  rmdir /s /q "%SYSTEMROOT%\SoftwareDistribution.bak"
)
if exist "%SYSTEMROOT%\system32\Catroot2.bak" (
  rmdir /s /q "%SYSTEMROOT%\system32\Catroot2.bak"
)
if exist "%SYSTEMROOT%\WindowsUpdate.log.bak" (
  del /s /q /f "%SYSTEMROOT%\WindowsUpdate.log.bak"
)
if exist "%SYSTEMROOT%\winsxs\pending.xml" (
  takeown /f "%SYSTEMROOT%\winsxs\pending.xml"
  attrib -r -s -h /s /d "%SYSTEMROOT%\winsxs\pending.xml"
  ren "%SYSTEMROOT%\winsxs\pending.xml" pending.xml.bak
)
if exist "%SYSTEMROOT%\SoftwareDistribution" (
  attrib -r -s -h /s /d "%SYSTEMROOT%\SoftwareDistribution"
  ren "%SYSTEMROOT%\SoftwareDistribution" SoftwareDistribution.bak
)
if exist "%SYSTEMROOT%\system32\Catroot2" (
  attrib -r -s -h /s /d "%SYSTEMROOT%\system32\Catroot2"
  ren "%SYSTEMROOT%\system32\Catroot2" Catroot2.bak
)
if exist "%SYSTEMROOT%\WindowsUpdate.log" (
  attrib -r -s -h /s /d "%SYSTEMROOT%\WindowsUpdate.log"
  ren "%SYSTEMROOT%\WindowsUpdate.log" WindowsUpdate.log.bak
)
 
:: ----- Reset the BITS service and the Windows Update service to the default security descriptor -----
 
sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
 
:: ----- Reregister the BITS files and the Windows Update files -----
 
cd /d %WINDIR%\system32
regsvr32.exe /s atl.dll
regsvr32.exe /s urlmon.dll
regsvr32.exe /s mshtml.dll
regsvr32.exe /s shdocvw.dll
regsvr32.exe /s browseui.dll
regsvr32.exe /s jscript.dll
regsvr32.exe /s vbscript.dll
regsvr32.exe /s scrrun.dll
regsvr32.exe /s msxml.dll
regsvr32.exe /s msxml3.dll
regsvr32.exe /s msxml6.dll
regsvr32.exe /s actxprxy.dll
regsvr32.exe /s softpub.dll
regsvr32.exe /s wintrust.dll
regsvr32.exe /s dssenh.dll
regsvr32.exe /s rsaenh.dll
regsvr32.exe /s gpkcsp.dll
regsvr32.exe /s sccbase.dll
regsvr32.exe /s slbcsp.dll
regsvr32.exe /s cryptdlg.dll
regsvr32.exe /s oleaut32.dll
regsvr32.exe /s ole32.dll
regsvr32.exe /s shell32.dll
regsvr32.exe /s initpki.dll
regsvr32.exe /s wuapi.dll
regsvr32.exe /s wuaueng.dll
regsvr32.exe /s wuaueng1.dll
regsvr32.exe /s wucltui.dll
regsvr32.exe /s wups.dll
regsvr32.exe /s wups2.dll
regsvr32.exe /s wuweb.dll
regsvr32.exe /s qmgr.dll
regsvr32.exe /s qmgrprxy.dll
regsvr32.exe /s wucltux.dll
regsvr32.exe /s muweb.dll
regsvr32.exe /s wuwebv.dll
 
:: ----- Resetting Winsock -----
netsh winsock reset
 
:: ----- Resetting WinHTTP Proxy -----
netsh winhttp reset proxy
 
:: ----- Set the startup type as automatic -----
sc config wuauserv start= auto
sc config bits start= auto
sc config DcomLaunch start= auto
 
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v LastWaitTimeout /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v DetectionStartTime /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v NextDetectionTime /f
 
:: ----- Starting the Windows Update services -----
net start bits
net start wuauserv
net start appidsvc
net start cryptsvc
net start DcomLaunch
net start msiserver
 
start ms-settings:windowsupdate
 
echo.
echo.
:ende
echo Fertig.
pause