Here you can find all mentioned stuff: https://forums.mydigitallife.net/threads/abbodi1406s-batch-scripts-repo.74197/
Hey, ENTST, you removed your code with that last edit! Too bad, I was just going to say "Look out, you're turning into a coder"
https://forums.mydigitallife.net/th...ion-guide-murphy78.47875/page-43#post-1496205 not enough code, in the 6 cmd's? The deleted part needs to be reviewed, i can't code but for me these low level code "scripts" do their job Simple to edit, for specific needs, that's why i deleted the shown code for winre.wim, some have 1 index, others have 2, so i will have to find a way to keep it working for more scenarios.
Revamped version of my DaRT Integration Tool (2.0): Code: Name: updating PW = DaRT2020 Code: ========================================================= What Architecture Is Your ISO ? ========================================================= [ 1 ] - x86 [ 2 ] - x64 ========================================================= * Type your option and press Enter: 2 ========================================================= Select the Windows Edition ========================================================= [ 1 ] - Windows 7 [ 2 ] - Windows 8.1 [ 3 ] - Windows 10 ========================================================= * Type your option and press Enter: 3 ========================================================= Select the Win 10 build... ========================================================= [ 1 ] - TH1 aka 1507 aka 10240.xxx [ 2 ] - TH2 aka 1511 aka 10586.xxx [ 3 ] - RS1 aka 1607 aka 14393.xxx [ 4 ] - RS2 aka 1703 aka 15063.xxx [ 5 ] - RS3 aka 1709 aka 16299.xxx [ 6 ] - RS4 aka 1803 aka 17134.xxx [ 7 ] - RS5 aka 1809 aka 17763.xxx [ 8 ] - RS6 aka 1903 and later aka 18362/3.xxx ========================================================= * Type one of the shown builds and press Enter: 8 ========================================================= Integrate DaRT In Boot.wim ? ========================================================= [ 1 ] - Integrate DaRT In Boot.wim [ 2 ] - Don't Integrate DaRT In Boot.wim ========================================================= * Type your option and press Enter: 1 ========================================================= Integrate DaRT In Winre.wim ? ========================================================= [ 1 ] - Integrate DaRT In Winre.wim [ 2 ] - Don't Integrate DaRT In Winre.wim ========================================================= * Type your option and press Enter: 1 ========================================================= Extracting Source ISO... ========================================================= 7-Zip 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21 Scanning the drive for archives: 1 folder, 1 file, 5258627072 bytes (5016 MiB) Extracting archive: Source_ISO\de_windows_10_business_editions_version_2004_updated_july_2020_x64_dvd_4299104f.iso -- Path = Source_ISO\de_windows_10_business_editions_version_2004_updated_july_2020_x64_dvd_4299104f.iso Type = Udf Physical Size = 5258627072 Comment = CPBA_X64FRE_DE-DE_DV9 Cluster Size = 2048 Created = 2020-07-11 02:00:00 Everything is Ok Folders: 84 Files: 899 Size: 5253212304 Compressed: 5258627072 ========================================================== DaRT Language Used : de-de ========================================================== ========================================================= Preparing DaRT 10... ========================================================= 7-Zip 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21 Scanning the drive for archives: 1 file, 8894690 bytes (8687 KiB) Extracting archive: DaRT_W10\Dart_w10.tpk -- Path = DaRT_W10\Dart_w10.tpk Type = wim Physical Size = 8894690 Size = 8589934592 Packed Size = 38013142 Method = LZMS:17 Cluster Size = 131072 Created = 2019-04-08 06:13:00 Modified = 2019-04-08 06:17:13 Version = 0.14 Multivolume = - Volume = 1 Volumes = 1 Images = 2 Everything is Ok Folders: 12 Files: 71 Size: 29258096 Compressed: 8894690 7-Zip 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21 Scanning the drive for archives: 1 file, 192990 bytes (189 KiB) Extracting archive: DaRT_W10\Dart_w10_de-DE.tpk -- Path = DaRT_W10\Dart_w10_de-DE.tpk Type = wim Physical Size = 192990 Size = 8589934592 Packed Size = 1722968 Method = LZMS:17 Cluster Size = 131072 Created = 2016-11-07 10:05:59 Modified = 2016-11-07 10:16:50 Version = 0.14 Multivolume = - Volume = 1 Volumes = 1 Images = 2 Everything is Ok Folders: 16 Files: 45 Size: 2194106 Compressed: 192990 7-Zip 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21 Scanning the drive for archives: 1 file, 31797780 bytes (31 MiB) Extracting archive: DaRT_W10\DebugTools_w10_rs6.tpk -- Path = DaRT_W10\DebugTools_w10_rs6.tpk Type = wim Physical Size = 31797780 Size = 8589934592 Packed Size = 148084534 Method = LZMS:17 Cluster Size = 131072 Created = 2019-04-07 22:12:45 Modified = 2019-04-07 22:24:35 Version = 0.14 Multivolume = - Volume = 1 Volumes = 1 Images = 2 Everything is Ok Folders: 62 Files: 627 Size: 129531852 Compressed: 31797780 Extracting file data: 73 KiB of 73 KiB (100%) done Done extracting files. ========================================================= Adding DaRT 10 To Boot.wim... ========================================================= Scanning "TEMP\Dart_w10\2\" 15 MiB scanned (35 files, 6 directories) Using LZX compression with 8 threads Archiving file data: 15 MiB of 15 MiB (100%) done Scanning "TEMP\Dart_w10_LP\2\" 1070 KiB scanned (22 files, 8 directories) Using LZX compression with 1 thread Archiving file data: 1070 KiB of 1070 KiB (100%) done Scanning "TEMP\Dart_w10_DeBug\2\" 66 MiB scanned (314 files, 31 directories) Using LZX compression with 8 threads Archiving file data: 66 MiB of 66 MiB (100%) done Scanning "TEMP\DaRT\" (loading as WIM path: "\Windows\System32")... 73 KiB scanned (1 files, 1 directories) Using LZX compression with 1 thread Archiving file data: 73 KiB of 73 KiB (100%) done ========================================================= Optimizing Boot.wim... ========================================================= "TEMP\ISO\Sources\boot.wim" original size: 563997 KiB Using LZX compression with 8 threads Archiving file data: 1066 MiB of 1066 MiB (100%) done "TEMP\ISO\Sources\boot.wim" optimized size: 417445 KiB Space saved: 146551 KiB ========================================================= Adding DaRT 10 To Winre.wim... ========================================================= Extracting file data: 419 MiB of 419 MiB (100%) done Done extracting files. Scanning "TEMP\Dart_w10\2\" 15 MiB scanned (35 files, 6 directories) Using LZX compression with 8 threads Archiving file data: 15 MiB of 15 MiB (100%) done Scanning "TEMP\Dart_w10_LP\2\" 1070 KiB scanned (22 files, 8 directories) Using LZX compression with 1 thread Archiving file data: 1070 KiB of 1070 KiB (100%) done Scanning "TEMP\Dart_w10_DeBug\2\" 66 MiB scanned (314 files, 31 directories) Using LZX compression with 8 threads Archiving file data: 66 MiB of 66 MiB (100%) done Scanning "TEMP\DaRT\" (loading as WIM path: "\Windows\System32")... 73 KiB scanned (1 files, 1 directories) Updating "\Windows\System32\fmapi.dll" in WIM image Using LZX compression with 1 thread Archiving file data: 0 bytes of 0 bytes (0%) done ========================================================= Optimizing WinRe... ========================================================= "TEMP\Winre\Winre.wim" original size: 469154 KiB Using LZX compression with 8 threads Archiving file data: 1161 MiB of 1161 MiB (100%) done "TEMP\Winre\Winre.wim" optimized size: 450354 KiB Space saved: 18799 KiB ========================================================= Putting Winre.wim Back In Install.wim... ========================================================= ========================================================= Optimizing Install.wim... ========================================================= "TEMP\ISO\Sources\install.wim" original size: 4861029 KiB Using LZX compression with 8 threads Archiving file data: 9409 MiB of 9409 MiB (100%) done "TEMP\ISO\Sources\install.wim" optimized size: 4280748 KiB Space saved: 580280 KiB ========================================================= Creating 10 x64 ISO... ========================================================= OSCDIMG 2.56 CD-ROM and DVD-ROM Premastering Utility Copyright (C) Microsoft, 1993-2012. All rights reserved. Licensed only for producing Microsoft authorized content. Scanning source tree (500 files in 41 directories) Scanning source tree complete (899 files in 85 directories) Computing directory information complete Image file is 5093523456 bytes (before optimization) Writing 899 files in 85 directories to Win_10_x64_With_DaRT_10.iso 100% complete Storage optimization saved 24 files, 14176256 bytes (1% of image) After optimization, image file is 5081409536 bytes Space saved because of embedding, sparseness or optimization = 14176256 Done. ========================================================= Cleanup TEMP dir... ========================================================= Press any key to continue . . .
OMG thanks for the update. Without me implementing DaRT and testing it I wouldn't have caught that my temp 20GB recovery partition wasn't being deleted after the apply image stage! With every release of Win10 (1507-1909) my script has worked in removing this partition, except for 2004, where I now have added OVERRIDE to the diskpart script! DOH! Code: If %FIRMWARE_TYPE%==UEFI ( echo sel vol w >x:\x.txt echo sel par 4 >>x:\x.txt echo del par override >>x:\x.txt echo sel par 3 >>x:\x.txt echo ext >>x:\x.txt echo sel par 1 >>x:\x.txt echo remove noerr >>x:\x.txt echo lis vol >>x:\x.txt diskpart /s x:\x.txt IF %ERRORLEVEL% NEQ 0 pause del x:\x.txt )
2004 creates the OEM partition after the others are created, could that be the cause of it not deleting your recovery partition?
I still have the real Recovery as the last partition. For bulk deployment I'm still using Legacy GhostCast. When this dummy recovery is booted it restores the OS, WinRE (with DaRT), new boot entries & then self deletes.. Perhaps diskpart is protecting the booted partition? Anyway, all working now!
I think you might need to remove the recovery attribute on the partition to delete it if you're not doing a full "clean" wipe. I'm unsure if Windows Setup handles this automatically or not. I seem to remember reading something about that when writing up my diskpart script.
I'm handling everything from scripts. The dummy recovery doesn't have id de94bba4-06d1-4d40-a16a-bfd50179d6ac or gpt attribute 0x8000000000000001 set.. It's just a standard primary...
Hmm, it's not a difficult concept starting from the idea of a freshly formatted drive, but starting from an existing drive with unknown amounts of partitions and not using the recovery id would take some detective work.
Spoiler: boot.wim @echo off color 1f :: TITLE Windows 10 Integrator cls :: Setting Tools environment path variables If exist "%WinDir%\SysWOW64" ( SET "HostArchitecture=amd64" ) else ( SET "HostArchitecture=x86" ) SET "DISM=%~dp0Tools\%HostArchitecture%\DISM\Dism.exe" SET "WimlibImagex=%~dp0Tools\%HostArchitecture%\wimlib-imagex.exe" SET "Zip=%~dp0Tools\%HostArchitecture%\7z.exe" :: Setting environment path variables SET "MOUNT=%~dp0Mount" SET "UPDATES=%~dp0Updates\%HostArchitecture%" SET "PEAddons=%~dp0PE_Addons\%HostArchitecture%" SET "BootWIM=%~dp0DVD\sources\boot.wim" SET "BootWIMTemp=%~dp0DVD\sources\boot_temp.wim" SET index=1 echo. echo.------------------------------------------------------------------------------- echo Mounting Image [WindowsPE] %index% echo.------------------------------------------------------------------------------- mkdir "%MOUNT%" "%DISM%" /Mount-Wim /WimFile:"%BootWIM%" /index:%index% /MountDir:"%MOUNT%" echo. echo.------------------------------------------------------------------------------- echo Extracting .CAB Package files to Temporary folder... echo.------------------------------------------------------------------------------- mkdir "%UPDATES%\Enablement\Temp" expand -f:win*.cab "%UPDATES%\Enablement\*.msu" "%UPDATES%\Enablement\Temp" >nul mkdir "%UPDATES%\Cumulative\Temp" expand -f:win*.cab "%UPDATES%\Cumulative\*.msu" "%UPDATES%\Cumulative\Temp" >nul echo. echo.------------------------------------------------------------------------------- ECHO Integrate Updates to Windows PE Image echo.------------------------------------------------------------------------------- "%DISM%" /Add-Package /Image:"%MOUNT%" /PackagePath:"%UPDATES%\ServicingStack" "%DISM%" /Add-Package /Image:"%MOUNT%" /PackagePath:"%UPDATES%\Enablement\Temp" "%DISM%" /Add-Package /Image:"%MOUNT%" /PackagePath:"%UPDATES%\Cumulative\Temp" "%DISM%" /Add-Package /Image:"%MOUNT%" /PackagePath:"%UPDATES%\WinRE" echo. echo.------------------------------------------------------------------------------- echo Unmounting image Image [WindowsPE] echo.------------------------------------------------------------------------------- "%DISM%" /Unmount-Wim /MountDir:"%MOUNT%" /commit SET index=2 echo. echo.------------------------------------------------------------------------------- echo Mounting Image [Windows Setup] %index% echo.------------------------------------------------------------------------------- "%DISM%" /Mount-Wim /WimFile:"%BootWIM%" /index:%index% /MountDir:"%MOUNT%" echo. echo.------------------------------------------------------------------------------- ECHO Integrate Updates to [Windows Setup] echo.------------------------------------------------------------------------------- "%DISM%" /Add-Package /Image:"%MOUNT%" /PackagePath:"%UPDATES%\ServicingStack" "%DISM%" /Add-Package /Image:"%MOUNT%" /PackagePath:"%UPDATES%\Enablement\Temp" "%DISM%" /Add-Package /Image:"%MOUNT%" /PackagePath:"%UPDATES%\Cumulative\Temp" "%DISM%" /Add-Package /Image:"%MOUNT%" /PackagePath:"%UPDATES%\WinRE" rd /q /s "%UPDATES%\Cumulative\Temp" >nul 2>&1 rd /q /s "%UPDATES%\Enablement\Temp" >nul 2>&1 echo. echo.------------------------------------------------------------------------------- echo Mount Image Registry echo.------------------------------------------------------------------------------- reg load HKLM\PE4-DEFAULT "%MOUNT%\Windows\System32\config\DEFAULT" reg load HKLM\PE4-NTUSER "%MOUNT%\Users\Default\NTUSER.DAT" reg load HKLM\PE4-SOFTWARE "%MOUNT%\Windows\System32\config\SOFTWARE" reg load HKLM\PE4-SYSTEM "%MOUNT%\Windows\System32\config\SYSTEM" echo. echo.------------------------------------------------------------------------------- echo Integrate [Acronis] to Windows Setup echo.------------------------------------------------------------------------------- echo Unpacking add-ons... "%Zip%" x "%PEAddons%\Acronis\*.WA" -o"%PEAddons%\Acronis\Temp\" -y 1>nul echo. echo Copying files... xcopy /s "%PEAddons%\Acronis\Temp\Program Files\*" "%MOUNT%\Program Files" /cherkyi 1>nul 2>nul xcopy /s "%PEAddons%\Acronis\Temp\Windows\*" "%MOUNT%\Windows" /cherkyi 1>nul 2>nul echo. echo Applying custom program settings. for /f "tokens=*" %%i in ('"dir /b "%PEAddons%\Acronis\Temp\*.reg"" 2^>nul') do ( echo.Importing [%%i] to Image Registry... regedit.exe /s REG IMPORT "%PEAddons%\Acronis\Temp\%%i" ) rd /q /s "%PEAddons%\Acronis\Temp" echo. echo.------------------------------------------------------------------------------- echo Copying [Dart-Files] to Windows Setup echo.------------------------------------------------------------------------------- "%DISM%" /Apply-image /ImageFile:"%PEAddons%\Dart\Dart.tpk" /Index:%index% /ApplyDir:"%MOUNT%" "%DISM%" /Apply-image /ImageFile:"%PEAddons%\Dart\Dart_ru-RU.tpk" /Index:%index% /ApplyDir:"%MOUNT%" "%DISM%" /Apply-image /ImageFile:"%PEAddons%\Dart\DebugTools_10.0.19041.tpk" /Index:%index% /ApplyDir:"%MOUNT%" echo. echo.------------------------------------------------------------------------------- echo Un-Mounting Image Registry echo.------------------------------------------------------------------------------- timeout /t 5 /NOBREAK >nul reg unload HKLM\PE4-DEFAULT reg unload HKLM\PE4-NTUSER reg unload HKLM\PE4-SOFTWARE reg unload HKLM\PE4-SYSTEM echo. echo.------------------------------------------------------------------------------- echo Unmounting image Image [Windows Setup] echo.------------------------------------------------------------------------------- "%DISM%" /Unmount-Wim /MountDir:"%MOUNT%" /commit rd /q /s "%MOUNT%" >nul 2>&1 echo. echo.------------------------------------------------------------------------------- echo Re-Building Source [Boot.wim] Image with compress maximum... echo.------------------------------------------------------------------------------- "%DISM%" /Export-Image /SourceImageFile:"%BootWIM%" /All /DestinationImageFile:"%BootWIMTemp%" /compress:max /checkintegrity move /y "%BootWIMTemp%" "%BootWIM%" >nul "%WimlibImagex%" optimize "%BootWIM%" --check --recompress ) echo. echo All done! echo. echo. echo Press any key to end the script. echo. Pause >nul :End