windows 8.1 updates

Discussion in 'Scripting' started by AhrimanSefid, Apr 26, 2014.

  1. AhrimanSefid

    AhrimanSefid MDL Junior Member

    Apr 12, 2010
    97
    0
    0
    #1 AhrimanSefid, Apr 26, 2014
    Last edited by a moderator: Apr 20, 2017
    I want to install windows 8.1 updates by script, But it doesn't recognize 32 & 64 bit and couldn't install.

    Code:
    @Echo off
    For %%# in (*.msu) Do (
        Echo: Installing update: %%#
        Wusa "%%#" /quiet /norestart
    )
    Echo Windows Update finished.
    Exit
     
  2. ricktendo64

    ricktendo64 MDL Expert

    Apr 20, 2008
    1,343
    1,931
    60
    #2 ricktendo64, Apr 26, 2014
    Last edited by a moderator: Apr 20, 2017
    Code:
    dism /online /add-package /packagepath:<path_to_folder_with_msu>
     
  3. AhrimanSefid

    AhrimanSefid MDL Junior Member

    Apr 12, 2010
    97
    0
    0
    I want use this code in DVD,I want put this to $OEM$ folder .so if its possible plz edit this code in that way
     
  4. Compo

    Compo MDL Member

    Mar 29, 2011
    137
    103
    10
    #4 Compo, Apr 27, 2014
    Last edited by a moderator: Apr 20, 2017
    As far as I can tell, all of Microsoft's .msu files contain the intended architecture in the form of -x86 or -x64 so all you should need to do is to identify the host OS and install accordingly using the same method as you were intending.

    Try this, it assumes that the script is located inside a directory on your DVD which contains all of the .msu's for both architectures:
    Code:
    @Echo off & SetLocal
    Set xNN=x%PROCESSOR_ARCHITECTURE:~-2%
    If %xNN% Equ x86 (If Defined PROCESSOR_ARCHITEW6432 Set xNN=x64)
    For %%A In (*-%xNN%*.msu) Do (Echo= Installing update: %%A
    Wusa "%%A" /quiet /norestart)
    Echo= Windows Update finished.
    It is untested because I do not have a Windows OS to test it on!