[REPO/HOW-TO/CHAT] Audit/Sysprep/Generalize; Setupcomplete/Firstlogon; Silent Install

Discussion in 'Scripting' started by s1ave77, Feb 11, 2017.

  1. haris_mdlf69

    haris_mdlf69 MDL Addicted

    Oct 23, 2018
    586
    997
    30
    I merge branding in autounattend.xml, no need for specialize.cmd if you only want to set brand details.
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="windowsPE">
            <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <ImageInstall>
                    <OSImage>
                        <InstallFrom>
                            <MetaData wcm:action="add">
                                <Key>/IMAGE/DESCRIPTION</Key>
                                <Value>Windows 10 Pro</Value>
                            </MetaData>
                        </InstallFrom>
                    </OSImage>
                </ImageInstall>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OEMInformation>
                    <Logo>%SystemRoot%\System32\OEM\logo.bmp</Logo>
                    <Manufacturer>Dell Inc.</Manufacturer>
                    <Model>Vostro 15-3568</Model>
                    <SupportHours>Monday to Friday 9 a.m. - 6 p.m.</SupportHours>
                    <SupportPhone>080-2510-8037</SupportPhone>
                    <SupportURL>https://www.dell.com/support/home/en-in</SupportURL>
                </OEMInformation>
            </component>
        </settings>
    </unattend>
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. migascalp

    migascalp MDL Senior Member

    Sep 18, 2009
    459
    785
    10
    The correct path should be:
    Code:
    \sources\$OEM$\$$\Setup\Scripts
     
  3. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    Path of logo.bmp it is correct:
    sources\$OEM$\$$\system32\OEM\logo.bmp
     
  4. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    #244 maargueb, Mar 31, 2024
    Last edited: Mar 31, 2024
    I tried the method , thank you for helping me
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="windowsPE">
            <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <ImageInstall>
                    <OSImage>
                        <InstallFrom>
                            <MetaData wcm:action="add">
                                <Key>/IMAGE/DESCRIPTION</Key>
                                <Value>Windows 10 Pro</Value>
                            </MetaData>
                        </InstallFrom>
                    </OSImage>
                </ImageInstall>
                <UserData>
                    <ProductKey>
                        <Key>W269N-WFGWX-YVC9B-4J6C9-T83GX</Key>
                    </ProductKey>
                </UserData>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="NonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <OEMInformation>
                    <Logo>%SystemRoot%\System32\OEM\logo.bmp</Logo>
                    <Manufacturer>Dell Inc.</Manufacturer>
                    <Model>Vostro 15-3568</Model>
                    <SupportHours>Monday to Friday 9 a.m. - 6 p.m.</SupportHours>
                    <SupportPhone>080-2510-8037</SupportPhone>
                    <SupportURL>https://www.dell.com/support/home/en-in</SupportURL>
                </OEMInformation>
            </component>
        </settings>
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <InputLocale>040c:0000040c</InputLocale>
                <SystemLocale>fr-FR</SystemLocale>
                <UILanguage>fr-FR</UILanguage>
                <UserLocale>fr-FR</UserLocale>
            </component>
        </settings>
    </unattend>
     
  5. haris_mdlf69

    haris_mdlf69 MDL Addicted

    Oct 23, 2018
    586
    997
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    Hi experts
    I prepared the setupcomlete script:
    Code:
    @echo off
    "%windir%\Setup\Scripts\Apps\GoogleChromeStandaloneEnterprise64.msi" /qb
    "%windir%\Setup\Scripts\Apps\vlc-3.0.20-win32.exe /L=1036 /S
    "%windir%\Setup\Scripts\StartIsBack\StartIsBackCfg.exe"    /install /elevated /silent" /f
    "%windir%\Setup\Scripts\Apps\winrar-x64-700.exe" /S
    "%windir%\Setup\Scripts\Apps\Revo.exe /verysilent
    "%windir%\Setup\Scripts\Apps\FSViewerSetup78.exe /S
    "%windir%\Setup\Scripts\Apps\Everything.exe /S
    "%windir%\Setup\Scripts\Apps\VisualCppRedist_AIO_x86_x64.exe /ai
    "%windir%\Setup\Scripts\Apps\DirectX_Redist_Repack_x86_x64.exe /ai
    "%windir%\Setup\Scripts\Apps\Rainmeter-4.5.18.exe /L=1036 /S
    regedit /S "%WINDIR%\Setup\Scripts\theme.reg"
    call %~dp0KMS_VL_ALL_AIO.cmd /s /a
    cd \
    (goto) 2>nul&rd /s /q "%~dp0"
    del /q /f "%0"
    But after installing Windows on Vm, I found that only three programs had been installed: winrar , chrome,starisback, kms_vl_all.:confused:

    [​IMG]
     
  7. migascalp

    migascalp MDL Senior Member

    Sep 18, 2009
    459
    785
    10
    Try your script in an already installed VM.
    delete
    Code:
    @echo off
    replaces
    Code:
    cd \
    (goto) 2>nul&rd /s /q "%~dp0"
    del /q /f "%0"
    by
    Code:
    pause
    and see what happens
    If you see that several installations are running at the same time
    Try before your command
    Code:
    start "" /wait /b YourCommand
     
  8. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    #248 maargueb, Apr 9, 2024
    Last edited: Apr 9, 2024
    Thank you
    The problem has been solved
     
  9. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    Why use:
    Code:
    pushd "%~dp0"
    Code:
    if exist
    Code:
    ) else (
    Code:
    )
    Can you explain?

    Exemple:

    Code:
    @echo off
    title OpenShell Installer
    pushd "%~dp0"
    if exist %windir%\SysWOW64 (
        OpenShellSetup64_4_4_191.msi /qb ADDLOCAL=StartMenu
    ) else (
        OpenShellSetup32_4_4_191.msi /qb ADDLOCAL=StartMenu
    )
    REGEDIT.EXE /S OpenShell.reg
    exit
     
  10. haris_mdlf69

    haris_mdlf69 MDL Addicted

    Oct 23, 2018
    586
    997
    30
    #250 haris_mdlf69, Apr 16, 2024
    Last edited: Apr 16, 2024
    This changes the current directory to the same directory where the batch script is located.
    used to check if a specific file or directory exists on the system.
    This is the "else" part of the "if" statement, which runs if the 64-bit directory doesn't exist.
    This closes the "if" statement.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    #251 maargueb, Apr 16, 2024
    Last edited: Apr 16, 2024
    Thank you for the explanation. Can these commands be replaced with others?
    -Can you help me change the script, knowing that I am a beginner?
     
  12. haris_mdlf69

    haris_mdlf69 MDL Addicted

    Oct 23, 2018
    586
    997
    30
    Depending on what you want to achieve, you can replace or modify these commands.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    Yes, I want to modify the script commands.
    Exemple:

    Code:
    @echo off
    
    And

    Code:
    cd \
    (goto) 2>nul&rd /s /q "%~dp0"
    del /q /f "%0"
     
  14. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    I want to try integrate dart10 tool on iso windows 10.
    How do I do this using script setupcomplete
     
  15. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    I want change the image of the windows 10 boot,
    I found this script on the forum, but I don't know how to use it, can you help?

    Code:
    @echo off
    
    pushd "%~dp0"
    
    set "nul=1>nul 2>nul"
    echo.
    echo =================================================================================
    cecho {0a}     Patch and Create Custom BOOTLOGO // MS Windows 10 LTSB X64 bootres.dll {#}
    echo.
    echo =================================================================================
    
    takeown /f C:\Windows\Boot\Resources\bootres.dll %nul%
    icacls C:\Windows\Boot\Resources\bootres.dll /grant admin:f %nul%
    
    copy /y C:\Windows\Boot\Resources\bootres.dll %~dp0\bootres.dll %nul%
    ren %~dp0\bootres.dll bootres_backup.dll %nul%
    copy /y C:\Windows\Boot\Resources\bootres.dll %~dp0\bootres.dll %nul%
    
    "%~dp0\rh.exe" -open "%~dp0\bootres.dll" -save %~dp0\RCDATA1 -action extract RCData1 -mask RCData
    
    ren %~dp0\RCDATA1\1.bin 1.wim %nul%
    
    md %~dp0\mnt %nul%
    
    dism /mount-wim /wimfile:%~dp0\RCDATA1\1.wim /index:1 /mountdir:%~dp0\mnt
    
    attrib -r %~dp0\logo\*.* %nul%
    attrib -r "%~dp0\mnt\*.*" %nul%
    
    "%~dp0\irfanview\i_view64.exe" %~dp0\logo\winlogo.png /resize=(82,72) /resample /dpi=(96,96) /convert=%~dp0\logo\winlogo1.bmp"
    "%~dp0\irfanview\i_view64.exe" %~dp0\logo\winlogo.png /resize=(102,90) /resample /dpi=(96,96) /convert=%~dp0\logo\winlogo2.bmp"
    "%~dp0\irfanview\i_view64.exe" %~dp0\logo\winlogo.png /resize=(129,115) /resample /dpi=(96,96) /convert=%~dp0\logo\winlogo3.bmp"
    "%~dp0\irfanview\i_view64.exe" %~dp0\logo\winlogo.png /resize=(98,115) /resample /dpi=(96,96) /convert=%~dp0\logo\winlogo3n.bmp"
    "%~dp0\irfanview\i_view64.exe" %~dp0\logo\winlogo.png /resize=(242,214) /resample /dpi=(96,96) /convert=%~dp0\logo\winlogo4.bmp"
    "%~dp0\irfanview\i_view64.exe" %~dp0\logo\winlogo.png /resize=(321,284) /resample /dpi=(96,96) /convert=%~dp0\logo\winlogo5.bmp"
    
    copy /y %~dp0\logo\winlogo1.bmp %~dp0\mnt\winlogo1.bmp %nul%
    copy /y %~dp0\logo\winlogo2.bmp %~dp0\mnt\winlogo2.bmp %nul%
    copy /y %~dp0\logo\winlogo3.bmp %~dp0\mnt\winlogo3.bmp %nul%
    copy /y %~dp0\logo\winlogo3n.bmp %~dp0\mnt\winlogo3n.bmp %nul%
    copy /y %~dp0\logo\winlogo4.bmp %~dp0\mnt\winlogo4.bmp %nul%
    copy /y %~dp0\logo\winlogo5.bmp %~dp0\mnt\winlogo5.bmp %nul%
    
    attrib +r "%~dp0\mnt\*.*" %nul%
    attrib +i "%~dp0\mnt\*.*" %nul%
    
    dism /unmount-wim /mountdir:%~dp0\mnt /commit
    wimlib-imagex optimize %~dp0\RCDATA1\1.wim --recompress %nul%
    
    Restorator.exe -open "%~dp0\bootres.dll" -assignON RCData %~dp0\RCData1\1.wim -saveAS c:\bootres.dll -exit
    rem "C:\Program Files\reshack\rh.exe" -open "%~dp0\logo\original\bootres.dll" -save c:\bootres.dll -action addoverwrite -res c:\RCDATA1\1.bin -mask RCData,1
    md %~dp0\patched %nul%
    copy /y C:\bootres.dll %~dp0\patched\bootres.dll %nul%
    ren %~dp0\patched\bootres.dll bootres_patched.dll %nul%
    echo.
    
    Signer64 /sign sign c:\bootres.dll
    
    copy /y c:\bootres.dll c:\windows\boot\resources\bootres.dll %nul%
    echo.
    
    Bcdedit.exe -set TESTSIGNING ON %nul%
    bcdedit.exe /set nointegritychecks ON %nul%
    echo.
    
    cecho {0a}Reboot.... {#}
    timeout /t 5
    shutdown /r /t 0
    
     
  16. SunLion

    SunLion MDL Addicted

    May 11, 2011
    817
    2,275
    30
    @maargueb

    Provide the link to where you found the script, please, for analysis.
     
  17. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
  18. SunLion

    SunLion MDL Addicted

    May 11, 2011
    817
    2,275
    30
    #258 SunLion, May 12, 2024
    Last edited: May 13, 2024
    I don't know if you want to modify the Boot LOGO image

    Or the Background image

    In my research I observed that many do not recommend editing Boot LOGO, as it can cause many problems for the Operating System.
    Personally, I never changed this.

    To modify the background image in boot.wim, I use the script below, together with the edited images.
    Note that images must be the same size and extension as the originals.
    For editing I suggest reading the tutorial "__Personnalisation des files pour Windows 7.pdf", attached.

    You can try this script I use to customize my windows 10... Adapt it to your needs...
    Good luck!!!

    EDITED (Add new script)

    19045Pegasus.7z
    password: mdl2024
    https://www.mediafire.com/file/jx0zuft2rp8xabu/19045Pegasus.7z/file
     

    Attached Files:

  19. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    35
    10
    #259 maargueb, May 12, 2024
    Last edited: May 12, 2024
    I want to modify the Boot LOGO image
    Thank you very much
    How to use: script"_732_W10_19045.xxxx_LTSC_x64_DaRT_Boot.cmd
    -What files do I put before running the script .
     
  20. SunLion

    SunLion MDL Addicted

    May 11, 2011
    817
    2,275
    30
    #260 SunLion, May 13, 2024
    Last edited: May 13, 2024
    You should just replace the images in the Reshack folder and edit the script by changing the names of the files you are using.

    Check carefully and everything should go well.

    Edit.
    The easiest way is to edit your images, observing size and format, rename them like those in the Reshack folder and replace them within that folder.

    This way you don't need to change anything in the script.

    Good luck!