How to create setupcomplete.cmd multiple arhiteture

Discussion in 'Windows 7' started by naser, Feb 18, 2013.

  1. naser

    naser MDL Junior Member

    Oct 4, 2012
    50
    17
    0
    hello all...how to create setupcomplete.cmd so multi architecture windows 7 x86 and windows 7 x64 AIO, 1dvd .ISO
    example :
    installing KB2533552-x86 KB2592687-x86
    KB2758694
    KB2506143-x64 KB2533552-x64 KB2592687-x64 KB2603229-x64

    How to..??

    Thanks in advance Bro...:worthy:
     
  2. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,369
    642
    60
    #2 NICK@NUMBER11, Feb 18, 2013
    Last edited by a moderator: Apr 20, 2017
    Here is the one that use for x86...

    Code:
    @ECHO OFF
    cd %~dp0
    start /wait Silverlight.exe /Q
    start /wait mpam-fe.exe /Q
    start /wait windows-kb890830-v4.17.exe /Q
    start /wait KB2772501-x86-all-fixiepropschema.exe 
    start /wait KB931125-x86.exe /Q:A /R:N
    start /wait KB2798897-rvkroots.exe /Q:A /R:N
    start /wait delmigprov.exe
    start /wait wusa.exe Windows8-RT-KB2770816-x86.msu /quiet /norestart
    start /wait wusa.exe Windows8-RT-KB2771431-x86.msu /quiet /norestart
    RMDIR /S /Q "C:\Windows\Setup\Scripts"
    exit
    
    and this is my x64 bit one too..

    Code:
    @ECHO OFF
    cd %~dp0
    start /wait Silverlight.exe /Q
    start /wait Windows-KB890830-x64-V4.17 /Q
    start /wait wusa.exe Windows8-RT-KB2771431-x64.msu /quiet /norestart
    start /wait KB2772501-x64-all-fixiepropschema 
    start /wait delmigprov.exe
    RMDIR /S /Q "C:\Windows\Setup\Scripts"
    exit
    
     
  3. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,369
    642
    60
    #3 NICK@NUMBER11, Feb 18, 2013
    Last edited by a moderator: Apr 20, 2017
    And this is one that i found that has both x64 & x86 within the same batch.. this may be what you are looking for,,,

    Code:
    @echo off
    for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set CDROM=%%i:
    echo Found CD-Rom as drive %CDROM%
    ::Begin hotfix install
    
    :Malicious software removal tool
    echo Installing Malicious Software Removal Tool
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\windows-kb890830-x64-v3.22.exe /Q
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\windows-kb890830-v3.22.exe /Q
    
    :Defender Definitions
    echo Installing Windows Defender Definition updates
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\WinDefUpdate\mpas-fe64.exe /Q
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\WinDefUpdate\mpas-fe.exe /Q
    
    :DirectX
    echo Updating DirectX
    start /wait %CDROM%\updates\directx\DXSETUP /silent
    
    :NET Framework 4
    echo Installing .NET 4 Framework
    ::start /wait Client\netfx_core_x64.msi EXTUI=1
    ::start /wait Extended\netfx_extended_x64.msi EXTUI=1
    start /wait %CDROM%\updates\dotNetFx40_Full_x86_x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2160841-x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2416472-x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2446708-x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2468871-v2-x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2478663-x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2487367-x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2518870-x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2533523-x64.exe /passive /norestart
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2539636-x64.exe /passive /norestart
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2416472-x86.exe /passive /norestart
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2446708-x86.exe /passive /norestart
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2468871-v2-x86.exe /passive /norestart
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2478663-x86.exe /passive /norestart
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2487367-x86.exe /passive /norestart
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2518870-x86.exe /passive /norestart
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2533523-x86.exe /passive /norestart
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\NDP40-KB2539636-x86.exe /passive /norestart
    
    :options
    ::Requires .NET 4
    echo Installing Super Calendar
    IF EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\WinCal-Win7-amd64-en-us.exe /S /v/qb
    IF NOT EXIST %SystemRoot%\SysWOW64 start /wait %CDROM%\updates\WinCal-Win7-x86-en-us.exe /S /v/qb
    echo Installing Pinball
    start /wait %CDROM%\updates\WinPinball-en-us.exe /S /v/qb
    
    :WPIW
    ::Begin WPIW
    echo Starting Windows Post-Install Wizard
    REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /V "Disable Script Debugger" /T "REG_SZ" /D "no" /F
    REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /V "DisableScriptDebuggerIE" /T "REG_SZ" /D "no" /F
    ::Start %CDROM%\WPI\wpi.exe
    
    ::all processing finished, delete used files, and EXIT::
    :CLEANUP
    start /wait %windir%\Microsoft.NET\Framework\v4.0.30319\ngen executequeueditems
    IF EXIST %SystemRoot%\SysWOW64 start /wait %windir%\Microsoft.NET\Framework64\v4.0.30319\ngen executequeueditems
    IF EXIST %windir%\Setup\scripts RD /S /Q %windir%\Setup\scripts >nul
    DEL /F /Q %0% >nul
    exit
     
  4. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,555
    664
    60
    #4 Flipp3r, Feb 18, 2013
    Last edited by a moderator: Apr 20, 2017
    You could also use Processor_Architecture. If you type set from the command prompt you will see the variable is in the system environment.
    example of usage:

    Code:
    if %processor_architecture% == AMD64 goto 64bit
    or
    Code:
    if %processor_architecture% == x86 start /wait wusa.exe Windows8-RT-KB2770816-x86.msu /quiet /norestart
     
  5. HALIKUS

    HALIKUS MDL Addicted

    Jul 29, 2009
    527
    369
    30
    #5 HALIKUS, Feb 20, 2013
    Last edited by a moderator: Apr 20, 2017
    ...and here is a little bit of everything...
    Code:
    @echo off
    for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set CDROM=%%i:
    echo Found CD-Rom as drive %CDROM%
    
    
    if not exist %SystemRoot%\system32\systeminfo.exe goto :warnthenexit
    
    systeminfo | find "OS Name" > %TEMP%\osname.txt
    FOR /F "usebackq delims=: tokens=2" %%i IN (%TEMP%\osname.txt) DO set vers=%%i
    
    echo %vers% | find "Windows Server 2012" > nul
    if %ERRORLEVEL% == 0 goto :ver_2012
    
    echo %vers% | find "Windows 8" > nul
    if %ERRORLEVEL% == 0 goto :ver_8
    
    echo %vers% | find "Windows 7" > nul
    if %ERRORLEVEL% == 0 goto :ver_7
    
    echo %vers% | find "Windows Server 2008r2" > nul
    if %ERRORLEVEL% == 0 goto :ver_2008r2
    
    echo %vers% | find "Windows Server 2008" > nul
    if %ERRORLEVEL% == 0 goto :ver_2008
    
    echo %vers% | find "Windows Vista" > nul
    if %ERRORLEVEL% == 0 goto :ver_vista
    
    goto :warnthenexit
    
    
    :ver_2012
    echo Windows Server 2012
    if %processor_architecture% == x86 call :x86
    if %processor_architecture% == AMD64 call :x64
    rem if %processor_architecture% == x86 start /wait wusa.exe Windows8-RT-KB2770816-x86.msu /quiet /norestart
    rem if %processor_architecture% == AMD64 start /wait wusa.exe Windows8-RT-KB2770816-x64.msu /quiet /norestart
    ::check activation status, and exit::
    WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul
    IF ERRORLEVEL 1 goto :NOT_LICENSED2012
    rem RD /S /Q "%WINDIR%\Setup\Scripts" >nul
    rem DEL /F /Q %0% >nul
    exit /b
    
    ::run loader, if not activated::
    :NOT_LICENSED2012
    rem start /wait %~dp0KMSpico.exe
    rem regedit /s %~dp0RunOnce.reg
    %~dp0AutoKMS.exe
    rem %windir%\Setup\Scripts\KMSnano_Install.exe /verysilent
    rem %programfiles%\KMSnano\VerySilent.cmd
    attrib -R -A -S -H *.*
    rem SHUTDOWN /R /T 5
    rem RMDIR /S /Q "%WINDIR%\Setup\Scripts"
    goto :exit
    
    
    :ver_8
    echo Windows 8
    if %processor_architecture% == x86 call :x86
    if %processor_architecture% == AMD64 call :x64
    rem if %processor_architecture% == x86 start /wait wusa.exe Windows8-RT-KB2770816-x86.msu /quiet /norestart
    rem if %processor_architecture% == AMD64 start /wait wusa.exe Windows8-RT-KB2770816-x64.msu /quiet /norestart
    ::check activation status, and exit::
    WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul
    IF ERRORLEVEL 1 goto :NOT_LICENSED8
    rem RD /S /Q "%WINDIR%\Setup\Scripts" >nul
    rem DEL /F /Q %0% >nul
    exit /b
    
    ::run loader, if not activated::
    :NOT_LICENSED8
    rem start /wait %~dp0KMSpico.exe
    rem regedit /s %~dp0RunOnce.reg
    %~dp0AutoKMS.exe
    rem %windir%\Setup\Scripts\KMSnano_Install.exe /verysilent
    rem %programfiles%\KMSnano\VerySilent.cmd
    attrib -R -A -S -H *.*
    rem SHUTDOWN /R /T 5
    rem RMDIR /S /Q "%WINDIR%\Setup\Scripts"
    goto :exit
    
    
    :ver_7
    echo Windows 7
    if %processor_architecture% == x86 call :x86
    if %processor_architecture% == AMD64 call :x64
    ::check activation status, and exit::
    WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul
    IF ERRORLEVEL 1 goto :NOT_LICENSED7
    rem RD /S /Q "%WINDIR%\Setup\Scripts" >nul
    rem DEL /F /Q %0% >nul
    exit /b
    
    ::run loader, if not activated::
    :NOT_LICENSED7
    %~dp0"Windows Loader.exe" /silent /preactivate
    attrib -R -A -S -H *.*
    SHUTDOWN /R /T 5
    rem RMDIR /S /Q "%WINDIR%\Setup\Scripts"
    goto :exit
    
    
    :ver_2008r2
    echo Windows Server 2008r2
    if %processor_architecture% == x86 call :x86
    if %processor_architecture% == AMD64 call :x64
    ::check activation status, and exit::
    WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul
    IF ERRORLEVEL 1 goto :NOT_LICENSED2008r2
    rem RD /S /Q "%WINDIR%\Setup\Scripts" >nul
    rem DEL /F /Q %0% >nul
    exit /b
    
    ::run loader, if not activated::
    :NOT_LICENSED2008r2
    %~dp0"Windows Loader.exe" /silent /preactivate
    attrib -R -A -S -H *.*
    SHUTDOWN /R /T 5
    rem RMDIR /S /Q "%WINDIR%\Setup\Scripts"
    goto :exit
    
    
    :ver_2008
    echo Windows Server 2008
    if %processor_architecture% == x86 call :x86
    if %processor_architecture% == AMD64 call :x64
    ::check activation status, and exit::
    WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul
    IF ERRORLEVEL 1 goto :NOT_LICENSED2008
    rem RD /S /Q "%WINDIR%\Setup\Scripts" >nul
    rem DEL /F /Q %0% >nul
    exit /b
    
    ::run loader, if not activated::
    :NOT_LICENSED2008
    %~dp0"Windows Loader.exe" /silent /preactivate
    attrib -R -A -S -H *.*
    SHUTDOWN /R /T 5
    rem RMDIR /S /Q "%WINDIR%\Setup\Scripts"
    goto :exit
    
    
    :ver_vista
    echo Windows Vista
    if %processor_architecture% == x86 call :x86
    if %processor_architecture% == AMD64 call :x64
    ::check activation status, and exit::
    WMIC /NAMESPACE:\\root\CIMV2 PATH SoftwareLicensingProduct WHERE LicenseStatus=1 GET LicenseStatus | findstr "1" >nul
    IF ERRORLEVEL 1 goto :NOT_LICENSEDVista
    rem RD /S /Q "%WINDIR%\Setup\Scripts" >nul
    rem DEL /F /Q %0% >nul
    exit /b
    
    ::run loader, if not activated::
    :NOT_LICENSEDVista
    %~dp0"Windows Loader.exe" /silent /preactivate
    attrib -R -A -S -H *.*
    SHUTDOWN /R /T 5
    rem RMDIR /S /Q "%WINDIR%\Setup\Scripts"
    goto :exit
    
    
    
    :warnthenexit
    echo Machine undetermined.
    if %processor_architecture% == x86 call :x86
    if %processor_architecture% == AMD64 call :x64
    goto :exit
    
    
    
    :x86
    echo Universal x86
    
    goto :eof
    
    
    :x64
    echo Universal x64
    
    goto :eof
    
    
    :exit
    exit 
    
    :eof
    
     
  6. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,369
    642
    60
    #6 NICK@NUMBER11, Feb 20, 2013
    Last edited by a moderator: Apr 20, 2017
    Dont think this is required for server 2012, as it only available in x64 bit not 32bit....


    Code:
    if %processor_architecture% == x86 call :x86
    
     
  7. naser

    naser MDL Junior Member

    Oct 4, 2012
    50
    17
    0
    oh many tanks for help all...



    :worthy:
     
  8. Padre_Pedro

    Padre_Pedro MDL Junior Member

    Mar 8, 2014
    53
    28
    0
    #8 Padre_Pedro, Aug 22, 2014
    Last edited: Aug 23, 2014
    I have the following SetupComplete.cmd:
    I want here to add also VBScript antivirus. What Command I have to add? for example: start /wait "" cmd /c cscript antivirus.vbs - or..? :confused:

    Help please!!!

     
  9. urie

    urie Moderator
    Staff Member

    May 21, 2007
    8,772
    3,121
    300
    Anti-virus that will depend on what anti-virus program all have different silent install switches if any.
     
  10. Padre_Pedro

    Padre_Pedro MDL Junior Member

    Mar 8, 2014
    53
    28
    0
    It is a script from Avira for shutdown Windows Defender - I want to integrate it into .iso Windows, but it is impossible to me...
     
  11. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,686
    10,145
    210
    Windows Defender shuts itself down when another A/V program is installed. The script would be redundant and probably cause more problems than it solves.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Padre_Pedro

    Padre_Pedro MDL Junior Member

    Mar 8, 2014
    53
    28
    0
    #12 Padre_Pedro, Aug 23, 2014
    Last edited: Aug 23, 2014
    START /B /WAIT WSCRIPT\DisableWDefender_en.vbs - This command doesn't work... :weeping:
     
  13. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    764
    425
    30
    #13 Chibi ANUBIS, Aug 23, 2014
    Last edited by a moderator: Apr 20, 2017
    Code:
    @echo off
    set ARCH=%PROCESSOR_ARCHITECTURE%
    echo %ARCH%
    if %ARCH%==x86 (
    x86\setup.exe
    ) else (
    x64\setup.exe
    )
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,369
    642
    60
    #14 NICK@NUMBER11, Aug 23, 2014
    Last edited by a moderator: Apr 20, 2017
    change code to

    Code:
    cscript DisableWDefender_en.vbs
     
  15. Padre_Pedro

    Padre_Pedro MDL Junior Member

    Mar 8, 2014
    53
    28
    0
    Yes it works! Many thanks NICK@NUMBER11 :clap3:only necessary /B to add for specifies batch mode, which does not display alerts, scripting errors, or input prompts.

    cscript DisableWDefender_en.vbs /B
     
  16. TeamOS

    TeamOS MDL Guru

    May 27, 2013
    3,040
    1,735
    120
    i can create more lines of x86\setup.exe and x64 for install more silent apps ?
     
  17. TeamOS

    TeamOS MDL Guru

    May 27, 2013
    3,040
    1,735
    120
    @echo off
    set ARCH=%PROCESSOR_ARCHITECTURE%
    echo %ARCH%
    if %ARCH%==x86 (
    x86\setup.exe
    ) else (
    x64\setup.exe
    )

    can i use that for install in x86 arch application's and x64 arch x64 application's ?? if want put in one aio DVD win x86-x64 that works ?
     
  18. SunLion

    SunLion MDL Novice

    May 11, 2011
    41
    12
    0
  19. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    764
    425
    30
    Yes ! You can create two folders : x86 and x64 and put the application's in arch folder, the script install the application's :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...