Sysprep problem with 24H2

Discussion in 'Windows 11' started by AnarethoS, Oct 8, 2024.

  1. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    Hi everyone!

    Some of you may know me fro the tools I make to created recovery partition for Windows 7/8/10/11.

    24H2 make me pull my hair!

    I use a CMD batch file to do a lots of job, before AND after Sysprep.

    Problem is, with 24H2, Sysprep is killing all instance of CMD.EXE, witch kill my script.

    Anyone one as an idea on how to prevent that?

    The only other solution for me would be to have to run multiple script, manually, one after each to run the pre-sysprep, the sysprep and the post-sysprep phase :(

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. alessio89g

    alessio89g MDL Member

    Jan 20, 2013
    248
    27
    10
    You could try to use Command Prompt instead of Terminal app, launched as TrustedInstaller user. During sysprep some system UWP apps get uninstalled, so if you use classic Command Prompt your script should continue to run. If you launched it as TrustedInstaller maybe sysprep can't kill it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Javac75

    Javac75 MDL Member

    Mar 16, 2015
    238
    323
    10
    This reminds me about reg.exe which also experienced problems at certain times, anticipated by creating reg2.exe.
    Maybe if you create cmd2.exe you can get around the problems you encounter.
    Obviously, this is just my guess.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    Oh! Good call. Didn't looked it if was Trusted Installer or the Real CMD though. I doubled-clicket on the CMD file form in AUDIT mode ...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    Well ... another problem.
    1) Install
    2) Audit mode
    3) Sysprep
    4) Reboot
    5) OOBE
    6) First login Yeah!)
    7) Reboot .... repair mode!

    I have to run BCDBOOT to fix that ... anyone have issue like that?

    24H2 has many bugs I found compared to 23H2 around sysprep and all that stuff.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    Bingo!
    I changed the default app and my script completed.

    So now I have to find a way to change that settings through registry.

    Copying CMD to CMD2 still launch in terminal which is the problem.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Dark Dinosaur

    Dark Dinosaur X Æ A-12

    Feb 2, 2011
    4,307
    6,254
    150
    #7 Dark Dinosaur, Oct 8, 2024
    Last edited: Oct 8, 2024
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    Here is the REG settings found on another forum just in case someone what to know!

    Code:
    Windows Console Host
    REG ADD "HKCU\Console\%%Startup" /v DelegationConsole /t REG_SZ /d "{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}" /f
    REG ADD "HKCU\Console\%%Startup" /v DelegationTerminal /t REG_SZ /d "{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}" /f
    For NEW Console host as default, add this additional key (For LEGACY set the value from 1 to 0)
    REG ADD "HKCU\Console" /v ForceV2 /t REG_DWORD /d 1 /f
    
    Let Windows Decide
    REG ADD "HKCU\Console\%%Startup" /v DelegationConsole /t REG_SZ /d "{00000000-0000-0000-0000-000000000000}" /f
    REG ADD "HKCU\Console\%%Startup" /v DelegationTerminal /t REG_SZ /d "{00000000-0000-0000-0000-000000000000}" /f
    
    Windows Terminal
    REG ADD "HKCU\Console\%%Startup" /v DelegationConsole /t REG_SZ /d "{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}" /f
    REG ADD "HKCU\Console\%%Startup" /v DelegationTerminal /t REG_SZ /d "{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}" /f
    
    I will use my installer script to make the change to the administrator accound. Anyway, it will be destroyed during the sysprep phase and the setting will be lost, so that's good!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,461
    92,527
    340
    You can force run cmd.exe by running "start conhost.exe" directly
     
  10. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,509
    2,740
    120
    Or remove stupid windows terminal and use legacy cmd / powershell
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    The tools I make are for "home technician" (or small store) that would like to create recovery partition ala Dell/HP style. I don't want to enfore the removal of Windows Terminal for their end user.

    In the firt part of my tools (the part that copy all the requiered files on the computer while in audit mode) ... I decided to put the registry keys. They are only for the current user (administrator) and that account is deleted during the sysprep phase so it has to effect on the end user later on.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    Now, on the other end, I have a weird bug with 24H2 build 1742.

    Original EN-US ISO
    1) Default install on a clean computer
    2) On OOBE, switch to AUDIT mode using CTRL+SHIFT+F3
    3) In AUDIT mode ... reseal the image (oobe, generalize, reboot)
    4) Go through the OOBE process (I use the BypassNRO script to not create a M$ accout)
    5) It should complete and go to the desktop..

    but on next reboot ... it goes into repair mode!

    Now downloader a more recent build number from UUPDUMP to check if it is still there ....
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,590
    60
    Same problem with latest buld from UUPDUMP ...

    Found that on another forum ...
    Code:
    Found the same issue but I have a workaround. There is an issue with the BCD configuration.
    
    After the Sysprep, I've added these 2 lines in the script WINDIR%\Setup\Scripts\SetupComplete.cmd :
    
    
    bcdedit -set {current} osdevice partition=C:
    bcdedit -set {current} device partition=C:
    
    
    Seems to work. Still, there is a real bug with 24H2 and Sysprep ...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. TheKranich

    TheKranich MDL Novice

    Nov 13, 2024
    1
    2
    0
    Sweet baby Jesus i just came here to say THANK YOU. Our old scripts at work rely heavyly on Batch/CMD Files. I was wondering what the problem with sysprep was, because my console window closed after a while. Never would i have thought, that literally the damn Window is closing, and it is not sysprep throwing an error. If i would not have found this forum whilst searching "24H2 TrustedInstaller Sysprep", i would have been f*cked. Plus now i have a cool new forum with a lot of windows specialists, so thats nice. Thank you again very much.
     
  16. Shortyportuguese

    Shortyportuguese MDL Addicted

    Apr 3, 2019
    529
    162
    30
    Also bug when updating online too
     
  17. Galamooth..

    Galamooth.. MDL Junior Member

    Sep 1, 2024
    58
    11
    0
    HHey guys, I'm trying to sysprep on 26100.3624, and I always get the same problem, "unrecoverable error." Can anyone confirm if this is a widespread problem? Or am I doing something wrong?