How enable Microsoft update?

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

  1. George King

    George King MDL Addicted

    Joined:
    Aug 5, 2009
    Messages:
    654
    Likes Received:
    521
    Trophy Points:
    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
     
  2. abbodi1406

    abbodi1406 MDL KB0000001

    Joined:
    Feb 19, 2011
    Messages:
    12,067
    Likes Received:
    55,424
    Trophy Points:
    340
  3. Enthousiast

    Enthousiast MDL Tester

    Joined:
    Oct 30, 2009
    Messages:
    35,561
    Likes Received:
    59,628
    Trophy Points:
    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
     
  4. George King

    George King MDL Addicted

    Joined:
    Aug 5, 2009
    Messages:
    654
    Likes Received:
    521
    Trophy Points:
    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 
    
     
  5. Reducer

    Reducer MDL Junior Member

    Joined:
    Jul 30, 2014
    Messages:
    50
    Likes Received:
    66
    Trophy Points:
    0
    I'm a total beginner at ps... What's the proper way to script such command in a .cmd file?
     
  6. abbodi1406

    abbodi1406 MDL KB0000001

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