I'm integrating Windows Update Client and also its registred as Microsoft update. But all the time after install I need to click in Windows Update on link then allow it in popup Window.. Anybody know how to force set it? And automatically search updates for all Microsoft Products? This is what I'm integrating Code: REM KB901037 Microsoft Update "%DISMX%" /image:"%IMAGE%" /add-package /packagepath:"%~dp0updates\extracted\WUClient-SelfUpdate-ActiveX-%ARCH%\update.mum" /LogLevel:%DISMErrorLevel% /LogPath:"%~dp0Logs\%INDEX%\Update.log" "%DISMX%" /image:"%IMAGE%" /add-package /packagepath:"%~dp0updates\extracted\WUClient-SelfUpdate-Aux-TopLevel-%ARCH%\update.mum" /LogLevel:%DISMErrorLevel% /LogPath:"%~dp0Logs\%INDEX%\Update.log" "%DISMX%" /image:"%IMAGE%" /add-package /packagepath:"%~dp0updates\extracted\WUClient-SelfUpdate-Core-TopLevel-%ARCH%\update.mum" /LogLevel:%DISMErrorLevel% /LogPath:"%~dp0Logs\%INDEX%\Update.log" if exist "%IMAGE%\Windows\System32\wuapp.exe" ( reg load HKLM\TempSoftware "%IMAGE%\windows\system32\config\Software" >nul reg add "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending\7971f918-a847-4430-9279-4a52d1efe18d" /v "ClientApplicationID" /t REG_SZ /d "My App" /f >nul reg add "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending\7971f918-a847-4430-9279-4a52d1efe18d" /v "RegisterWithAU" /t REG_DWORD /d 1 /f >nul reg unload HKLM\TempSoftware >nul ) EDIT: Maybe I found that key, going to try it in offline image Code: reg add "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v "EnableFeaturedSoftware" /t REG_DWORD /d 1 /f >nul
Old setupcomplete trick by @murphy78: Code: @echo off echo Set ServiceManager = CreateObject^("Microsoft.Update.ServiceManager"^)>%TEMP%\MSU.vbs echo ServiceManager.ClientApplicationID = "My App">>%TEMP%\MSU.vbs echo Set NewUpdateService = ServiceManager.AddService2^("7971f918-a847-4430-9279-4a52d1efe18d",7,""^)>>%TEMP%\MSU.vbs %windir%\system32\wscript.exe "%TEMP%\MSU.vbs" >nul
Thanks guys, but it can be done into offine image without these scripts. My goal was to prepare it inside image without running script on installed Windows or during setup. I tested it now and it works as expected. These reg keys enable Microsoft update in offline image. Code: reg load HKLM\TempSoftware "%ASSIGNLETTER%:\windows\system32\config\Software" >nul reg add "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending\7971f918-a847-4430-9279-4a52d1efe18d" /v "ClientApplicationID" /t REG_SZ /d "My App" /f >nul reg add "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending\7971f918-a847-4430-9279-4a52d1efe18d" /v "RegisterWithAU" /t REG_DWORD /d 1 /f >nul reg add "HKLM\TempSoftware\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v "EnableFeaturedSoftware" /t REG_DWORD /d 1 /f >nul reg unload HKLM\TempSoftware >nul
Code: powershell -nop -c "(new-object -c 'Microsoft.Update.ServiceManager').AddService2('7971f918-a847-4430-9279-4a52d1efe18d',7,'')" make sure it's admin cmd
Batch version, non vbscript/powershell, because why not Spoiler pre Win 10 Code: @echo off set "_m=7971f918-a847-4430-9279-4a52d1efe18d" set "_w=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" set "_u=%_w%\Auto Update" net stop wuauserv 2>nul reg delete "%_w%\Services" /f /v "DefaultService" 2>nul reg delete "%_w%\Services\%_m%" /f 2>nul reg add "%_w%\Services\Pending\%_m%" /f /v "RegisterWithAU" /t REG_DWORD /d 1 reg add "%_w%\Services\Pending" /f /v "ValidatedPreWsus3RegistrationRequests" /t REG_DWORD /d 1 net start wuauserv 2>nul ping localhost >nul reg query "%_u%" /v AUOptions 2>nul | find /i "0x1" 1>nul && (reg add "%_u%" /f /v "AUOptions" /t REG_DWORD /d 2® add "%_u%" /f /v "AUOptions_bak" /t REG_DWORD /d 1) wuauclt.exe /DetectNow ping localhost >nul reg query "%_u%" /v AUOptions_bak 1>nul 2>nul && (reg add "%_u%" /f /v "AUOptions" /t REG_DWORD /d 1® delete "%_u%" /f /v "AUOptions_bak") exit /b Win 10/11 Code: @echo off set "_m=7971f918-a847-4430-9279-4a52d1efe18d" set "_w=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" net stop usosvc 2>nul net stop wuauserv 2>nul reg delete "%_w%\Services" /f /v "DefaultService" 2>nul reg delete "%_w%\Services\%_m%" /f 2>nul reg add "%_w%\Services\Pending\%_m%" /f /v "RegisterWithAU" /t REG_DWORD /d 1 reg add "%_w%\Services\Pending" /f /v "ValidatedPreWsus3RegistrationRequests" /t REG_DWORD /d 1 del /f /q %ProgramData%\USOPrivate\UpdateStore\* net start wuauserv 2>nul net start usosvc 2>nul ping localhost >nul UsoClient.exe RefreshSettings exit /b Or for all Code: @echo off pushd "%SystemRoot%\System32\" set "_m=7971f918-a847-4430-9279-4a52d1efe18d" set "_w=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" set "_u=%_w%\Auto Update" if exist "UsoClient.exe" net stop usosvc 2>nul net stop wuauserv 2>nul reg delete "%_w%\Services" /f /v "DefaultService" 2>nul reg delete "%_w%\Services\%_m%" /f 2>nul reg add "%_w%\Services\Pending\%_m%" /f /v "RegisterWithAU" /t REG_DWORD /d 1 reg add "%_w%\Services\Pending" /f /v "ValidatedPreWsus3RegistrationRequests" /t REG_DWORD /d 1 if exist "UsoClient.exe" del /f /q %ProgramData%\USOPrivate\UpdateStore\* net start wuauserv 2>nul if exist "UsoClient.exe" net start usosvc 2>nul ping localhost >nul reg query "%_u%" /v AUOptions 2>nul | find /i "0x1" 1>nul && (reg add "%_u%" /f /v "AUOptions" /t REG_DWORD /d 2® add "%_u%" /f /v "AUOptions_bak" /t REG_DWORD /d 1) if exist "UsoClient.exe" (UsoClient.exe RefreshSettings) else (wuauclt.exe /DetectNow) ping localhost >nul reg query "%_u%" /v AUOptions_bak 1>nul 2>nul && (reg add "%_u%" /f /v "AUOptions" /t REG_DWORD /d 1® delete "%_u%" /f /v "AUOptions_bak") exit /b
Thanks. Problem with the PS version is that, by default, it will deny executing random scripts you throw at it. The batch version should work OOB.