How enable Microsoft update?

Discussion in 'Windows 7' started by George King, Dec 11, 2020.

  1. George King

    George King MDL Addicted

    Aug 5, 2009
    654
    521
    30
    #1 George King, Dec 11, 2020
    Last edited: Dec 11, 2020
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    35,561
    59,628
    450
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. George King

    George King MDL Addicted

    Aug 5, 2009
    654
    521
    30
    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 
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Reducer

    Reducer MDL Junior Member

    Jul 30, 2014
    50
    66
    0
    I'm a total beginner at ps... What's the proper way to script such command in a .cmd file?
     
  5. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    12,067
    55,424
    340
    Code:
    powershell -nop -c "(new-object -c 'Microsoft.Update.ServiceManager').AddService2('7971f918-a847-4430-9279-4a52d1efe18d',7,'')"
    make sure it's admin cmd