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

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

  1. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    36
    10
    After using the script : error
    thank you for helping me

    Code:
    ===========================================================
    redits: maxXPsoft and MyselfIdem
    ===========================================================
    
    
    
    ===========================================================
    reating Work folders...
    ===========================================================
    one...
    
    
    ress a key to start
    
    
    cript Started At 14:35:29,70
    
    
    ===========================================================
    D:\[_CUSTOM_]\W10\19045\W10_19045.4355_EnterpriseS_x64_DaRT\sources"\background
    cli.bmp
    ===========================================================
    
    
    ===========================================================
    D:\[_CUSTOM_]\W10\19045\W10_19045.4355_EnterpriseS_x64_DaRT\sources"\spwizimg.d
    l
    ===========================================================
    
    
    odifying Boot 1
    ===========================================================
    
    util Gestion et maintenance des images de déploiement
    ersion : 6.1.7600.16385
    
    
    rreur : 3
    
    e chemin d'accès spécifié est introuvable.
    
    e fichier journal DISM se trouve à l'emplacement C:\Windows\Logs\DISM\dism.log
    
    
    ===========================================================
    :\Boot1\sources\background.bmp
    ===========================================================
    
    
    ===========================================================
    :\Boot1\sources\spwizimg.dll
    ===========================================================
    
    
    ===========================================================
    :\Boot1\Windows\System32\winpe.jpg
    ===========================================================
    
    
    ===========================================================
    :\Boot1\Windows\System32\winre.jpg
    ===========================================================
    
    
    one...
    
    oot 1 modified...
    ===========================================================
    
    
    ===========================================================
    ress a key to Save/Unmount Boot 1
    ===========================================================
    
    util Gestion et maintenance des images de déploiement
    ersion : 6.1.7600.16385
    
    
    rreur : 50
    
    ette demande n'est pas prise en charge.
    
    e fichier journal DISM se trouve à l'emplacement C:\Windows\Logs\DISM\dism.log
    
    
    
    odifying Boot 2
    ===========================================================
    
    util Gestion et maintenance des images de déploiement
    ersion : 6.1.7600.16385
    
    
    rreur : 3
    
    e chemin d'accès spécifié est introuvable.
    
    e fichier journal DISM se trouve à l'emplacement C:\Windows\Logs\DISM\dism.log
    
    
    ===========================================================
    :\Boot2\sources\background.bmp
    ===========================================================
    
    
    ===========================================================
    :\Boot2\sources\spwizimg.dll
    ===========================================================
    
    
    ===========================================================
    :\Boot2\Windows\System32\setup.bmp
    ===========================================================
    
    
    ===========================================================
    :\Boot2\Windows\System32\winpe.jpg
    ===========================================================
    
    
    ===========================================================
    :\Boot2\Windows\System32\winre.jpg
    ===========================================================
    
    
    one...
    
    oot 2 modified...
    ===========================================================
    
    
    ===========================================================
    ress a key to Save/Unmount Boot 2
    ===========================================================
    
    
    util Gestion et maintenance des images de déploiement
    ersion : 6.1.7600.16385
    
    
    rreur : 50
    
    ette demande n'est pas prise en charge.
    
    e fichier journal DISM se trouve à l'emplacement C:\Windows\Logs\DISM\dism.log
    
    
    ===========================================================
    ress a key to Export Boot.wim
    ===========================================================
    
    
    Code:
    ===========================================================
    redits: maxXPsoft and MyselfIdem
    ===========================================================
    
    
    ===========================================================
    reating Work folders...
    ===========================================================
    one...
    
    
    ress a key to start
    
    
    cript Started At 14:35:29,70
    
    
    ===========================================================
    D:\[_CUSTOM_]\W10\19045\W10_19045.4355_EnterpriseS_x64_DaRT\sources"\background
    cli.bmp
    ===========================================================
    
    
    ===========================================================
    D:\[_CUSTOM_]\W10\19045\W10_19045.4355_EnterpriseS_x64_DaRT\sources"\spwizimg.d
    l
    ===========================================================
    
    
    odifying Boot 1
    ===========================================================
    
    util Gestion et maintenance des images de déploiement
    ersion : 6.1.7600.16385
    
    
    rreur : 3
    
    e chemin d'accès spécifié est introuvable.
    
    e fichier journal DISM se trouve à l'emplacement C:\Windows\Logs\DISM\dism.log
    
    
    ===========================================================
    :\Boot1\sources\background.bmp
    ===========================================================
    
    
    ===========================================================
    :\Boot1\sources\spwizimg.dll
    ===========================================================
    
    
    ===========================================================
    :\Boot1\Windows\System32\winpe.jpg
    ===========================================================
    
    
    ===========================================================
    :\Boot1\Windows\System32\winre.jpg
    ===========================================================
    
    
    one...
    
    oot 1 modified...
    ===========================================================
    
    
    ===========================================================
    ress a key to Save/Unmount Boot 1
    ===========================================================
    
    util Gestion et maintenance des images de déploiement
    ersion : 6.1.7600.16385
    
    
    rreur : 50
    
    ette demande n'est pas prise en charge.
    
    e fichier journal DISM se trouve à l'emplacement C:\Windows\Logs\DISM\dism.log
    
    
    
    odifying Boot 2
    ===========================================================
    
    util Gestion et maintenance des images de déploiement
    ersion : 6.1.7600.16385
    
    
    rreur : 3
    
    e chemin d'accès spécifié est introuvable.
    
    e fichier journal DISM se trouve à l'emplacement C:\Windows\Logs\DISM\dism.log
    
    
    ===========================================================
    :\Boot2\sources\background.bmp
    ===========================================================
    
    
    ===========================================================
    :\Boot2\sources\spwizimg.dll
    ===========================================================
    
    
    ===========================================================
    :\Boot2\Windows\System32\setup.bmp
    ===========================================================
    
    
    ===========================================================
    :\Boot2\Windows\System32\winpe.jpg
    ===========================================================
    
    
    ===========================================================
    :\Boot2\Windows\System32\winre.jpg
    ===========================================================
    
    
    one...
    
    oot 2 modified...
    ===========================================================
    
    
    ===========================================================
    ress a key to Save/Unmount Boot 2
    ===========================================================
    
    
    util Gestion et maintenance des images de déploiement
    ersion : 6.1.7600.16385
    
    
    rreur : 50
    
    ette demande n'est pas prise en charge.
    
    e fichier journal DISM se trouve à l'emplacement C:\Windows\Logs\DISM\dism.log
    
    
    ===========================================================
    ress a key to Export Boot.wim
    ===========================================================
    
    
     
  2. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,128
    3,776
    60
    Try it with the images I sent for testing... If it works for you, add your images, but keep the same name so you don't have to edit the script. This is just a suggestion.

    Before running the script as administrator, you must edit it to include the bin.wim file path, i.e.:

    :: ################################################################
    :: Update the DVDsources path according to your files
    :: ################################################################
    set DVDsources="D:\[_CUSTOM_]\W10\19045\W10_19045.4355_EnterpriseS_x64_DaRT\sources"

    Try it and see if it works!
     
  3. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    36
    10
    What files do I add before running the script : boot.wim or ( ex : widows ltsc 2019 iso) ?

    [​IMG]
     
  4. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,128
    3,776
    60
    @maargueb

    I edited the script to make some steps easier, such as editing images and file paths.

    Download this new package:

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


    As I said before, if you want to change the image, I suggest you place it in the original's place within the Reshack folder, observing the following:

    IMG1.jpg (this image is originally 24-bit BITMAP and then renamed to JPG)
    IMG2.bmp (24-bit BITMAP image)
    Bitmap516.bmp (customized 24-bit BITMAP image)

    In my case, I extract all the ISO content that I want to modify to a folder and add the path to the script (line 40):
    set DVDsources="D:\[_CUSTOM_]\W10\19045\W10_19045.4355_EnterpriseS_x64_DaRT\sources"

    Run the script as administrator

    There is no need to add anything else.

    The script will modify the file D:\[_CUSTOM_]\W10\19045\W10_19045.4355_EnterpriseS_x64_DaRT\sources\Boot.wim

    Try!
     
  5. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    36
    10
    I extracted the Windows lts2019 ISO content and placed it in the following path:

    Code:
    C:\Users\username\Desktop\19045Pegasus 
    Run the script as administrator script
    An error appeared:

    [​IMG]
     
  6. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,128
    3,776
    60
    #266 SunLion, May 13, 2024
    Last edited: May 13, 2024
    Try extracting the ISO to a short path, for example C:\LTSC2019.

    Or, if you prefer, extract the Pegasus folder to C:\
    Create a "DVD" folder inside the C:\Pegasus folder and extract the ISO contents to the DVD folder
    This way everything will be in C:\
    Change DVD folder path in script, line 40

    IMPORTANT:
    Whenever an error occurs with dism, do a cleanup before starting again.

    Create the Cleaner.cmd script with the content below:

    pushd "%CD%"
    CD /D "%~dp0"

    DISM /Cleanup-Wim
    IF EXIST boot1 RD /S /Q boot1
    IF EXIST boot2 RD /S /Q boot2
    IF EXIST "%~dp0Temp\Export\boot.wim" DEL /F /S /Q "%~dp0Temp\Export\boot.wim"
    IF EXIST "%~dp0Temp" RD /S /Q "%~dp0Temp"
    if exist "Reshack\spwizimg.dll" del /f /q "Reshack\spwizimg.dll"
    if exist "Reshack\spwizimg732_new.dll" del /f /q "Reshack\spwizimg732_new.dll"
    if exist "Reshack\spwizimg732_new.log" del /f /q "Reshack\spwizimg732_new.log"


    Save it to Pegasus folder and run as administrator
     
  7. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    36
    10
    The path is correct in the script (line 40):?

    Code:
    set DVDsources="D:\19045Pegasus\DVD\source
     
  8. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,128
    3,776
    60
    #268 SunLion, May 13, 2024
    Last edited: May 14, 2024
    If you extracted it to directory "D:\" it would look like this:

    set DVDsources="D:\19045Pegasus\DVD\sources"

    If you extract it to C:\, it would look like the attached images:

     

    Attached Files:

  9. maargueb

    maargueb MDL Member

    Jun 9, 2019
    220
    36
    10
    Thank you, after installing Windows on the VM :
    [​IMG]
    [​IMG]


    Another question:
    How can I change the image:
    Bitmap516_SunLion.bmp


    [​IMG]
     
  10. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,128
    3,776
    60
    You can edit the image with Photoshop, remembering to save it as a 24-bit bitmap and keep the same size.

    In the package there is a folder with three more ready-made images, if you want to use them.

    Good luck!
     
  11. jineso

    jineso MDL Senior Member

    Oct 8, 2021
    312
    77
    10
    Thanks a lot for the amazing info, Please I am trying to find a way to automate installing some or windows features components that are located here:
    upload_2025-1-13_14-34-30.png
    Where may I add it?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,128
    3,776
    60
    You can use DISM or Powershell.

    See the examples in the attachments.

    Good luck!
     

    Attached Files:

  13. migascalp

    migascalp MDL Addicted

    Sep 18, 2009
    516
    883
    30
    Bing Wallpaper (standard exe)

    Download
    https://store.rg-adguard.net
    Productld:xpfp7f8rl7mb1w

    Standalone Silent Install (rar sfx)

    Content:
    Code:
    \BingWallpaper
        Bing Wallpaper_2.0.2.1_Machine_neutral_en-us.exe
        BingWallpaper.cmd
    BingWallpaper.cmd:
    Code:
    @echo off
    setlocal EnableDelayedExpansion
    reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\BingWallpaper" >nul 2>&1 || (
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\BingWallpaper" /v "BingWallpaper" /d \""%~dp0BingWallpaper.cmd\"" /f >nul
        goto :eof
    )
    
    for /f "delims=" %%i in ('dir /b "%~dp0Bing*.exe" 2^> nul') do (
        REM silent install
        Reg.exe add "HKCU\SOFTWARE\Microsoft\BingWallpaperApp" /v "ShowHomeScreen" /t REG_SZ /d "2" /f >nul 2>&1
    
        start "" /wait /b "%~dp0%%i" /C:"MsiExec.exe /i BWCInstaller.msi /qn"
    
        REM settings
        tasklist.exe /FI "IMAGENAME eq BingWallpaperApp.exe" 2>nul | find /I /N "BingWallpaperApp.exe" >nul && taskkill.exe /f /im "BingWallpaperApp.exe" >nul
        Reg.exe add "HKCU\SOFTWARE\Microsoft\BingWallpaperApp" /v "FirstRun" /t REG_DWORD /d "2" /f >nul 2>&1
        Reg.exe add "HKCU\SOFTWARE\Microsoft\BingWallpaperApp" /v "NotificationState" /t REG_SZ /d "0" /f >nul 2>&1
        Reg.exe add "HKCU\SOFTWARE\Microsoft\BingWallpaperApp" /v "ImageChangeNotificationState" /t REG_SZ /d "0" /f >nul 2>&1
        Reg.exe add "HKCU\SOFTWARE\Microsoft\BingWallpaperApp" /v "RecommendationsNotificationState" /t REG_SZ /d "0" /f >nul 2>&1
        Reg.exe add "HKCU\SOFTWARE\Microsoft\BingWallpaperApp" /v "OverrideWallpaper" /t REG_SZ /d "1" /f >nul 2>&1
    )
    
    cd \
    (goto) 2>nul&rd /s /q "%~dp0"
    Archive comment:
    Code:
    Path=%windir%\Temp
    Setup=<hide>BingWallpaper\BingWallpaper.cmd
    SetupCode=0
    Silent=1
    Overwrite=1
    PyBingWallpaper

    Download

    Standalone Silent Install (rar sfx)

    Content:
    Code:
    \PyBingWallpaper
       PyBingWallpaper.cmd
       pybingwp-1-6-0.exe
    PyBingWallpaper.cmd:
    Code:
    @echo off
    setlocal EnableDelayedExpansion
    reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\PyBingWallpaper" >nul 2>&1 || (
        reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\PyBingWallpaper" /v "PyBingWallpaper" /d \""%~dp0PyBingWallpaper.cmd\"" /f >nul
        goto :eof
    )
    
    for /f "delims=" %%i in ('dir /b "%~dp0pybingwp*.exe"') do (start "" /wait /b "%~dp0%%i" /S)
    
    
    cd \
    (goto) 2>nul&rd /s /q "%~dp0"
    Archive comment:
    Code:
    Path=%windir%\Temp
    Setup=<hide>PyBingWallpaper\PyBingWallpaper.cmd
    SetupCode=0
    Silent=1
    Overwrite=1
     
  14. yantzila

    yantzila MDL Novice

    Feb 27, 2010
    24
    1
    0
    sorry dono where to ask what this silent install switch for microsoftedgestandaloneinstallerx64.exe,anyone can help
     
  15. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,594
    93,454
    340
    Code:
    start "" /w MicrosoftEdgeStandaloneInstallerX64.exe /silent /installsource windows /enterprise /install "appguid={56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}&needsadmin=True&brand=GGLS"
     
  16. yantzila

    yantzila MDL Novice

    Feb 27, 2010
    24
    1
    0
    tq sir....bigs helps
     
  17. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,678
    1,692
    150
    #277 tcntad, Jun 15, 2025
    Last edited: Jun 15, 2025
    Works pretty good with my W10 ISO now I wanna remember W11 is pretty much the same right?
    23H2 changes main background but reverts back to purple after small window appears
    24H2 It changes main background for setup but not the smaller window and doesnt add your logo

    Basically the only changes ive made is
    set dvd= path to dvdfolder
    set oscd= path to oscdimg
    and added section to create ISO, that works fine.

    It seems to copy everything like it should, no actual errors. I whonder if its beacuse I have an AutoUnattend.xml .. (nope it isnt)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,128
    3,776
    60
    For Windows 11 I use another script to edit only boot.wim 1 and 2.

    I'll compress it for you.
     
  19. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,678
    1,692
    150
    #279 tcntad, Jun 15, 2025
    Last edited: Jun 15, 2025
    Thanks, appreciate it!

    I just noticed now in W10 that the buttons etc are misaligned in edited ISO compared to my first
    Minor details but I might do this manually for W10 as I moved on to W11 but I wanna integrate this with my own script maybe
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. SunLion

    SunLion MDL Expert

    May 11, 2011
    1,128
    3,776
    60
    @tcntad

    Here is the package for 26100.

    It is a bit different, because you use different image formats in some cases.

    There are two scripts:

    1 - For boot.wim where index 1 has been removed, leaving only index 2: Pegasus_W11_26100.xxxx_LTSC_2024_Boot_Single.cmd

    2 - For untouched boot.wim, which keeps both indexes, 1 and 2: Pegasus_W11_26100.xxxx_LTSC_2024_Boot_Full.cmd

    See if it works well for you.

    26100Pegasus.7z
    https://www.mediafire.com/file/r4e7z41ny4hnt4x/26100Pegasus.7z/file
    psw: mdl2025