Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 53 additions & 15 deletions MediaCreationTool.bat
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
@goto latest at github.com/AveYo/MediaCreationTool.bat
:Universal MCT wrapper script for all Windows 10/11 versions from 1507 to 23H2!
:Universal MCT wrapper script for all Windows 10/11 versions from 1507 to 25H2!
:: Nothing but Microsoft-hosted source links and no third-party tools; script just configures an xml and starts MCT
:: Ingenious support for business editions (Enterprise / VL) selecting language, x86, x64 or AiO inside the MCT GUI
:: Changelog: 2023.11.29 stable
:: Changelog: 2025.11.22 updated for 24H2 and 25H2
:: - Added Windows 11 24H2 (26100.4349) and 25H2 (26200.7171) support
:: - Enhanced TPM/hardware bypass for 24H2/25H2 with HwReqChk and LabConfig registry keys
:: - all issues ironed out; upgrade keeping files from Eval editions too; pickup $ISO$ dir content to add on media
:: - DU in 11: auto installs 22000.556 atm; older skip_11_checks, without Server label; Home offline local account
:: on upgrade: latest build, on offline install: 11 23H2 22631.2861 / 11 22H2 22621.1702 / 11 21H2 22000.318 / 22H2 19045.2965 / 21H2 19044.1288 / 21H1 19043.1348 / 20H2 19042.1052
:: on upgrade: latest build, on offline install: 11 25H2 26200.7171 / 11 24H2 26100.4349 / 11 23H2 22631.2861 / 11 22H2 22621.1702 / 11 21H2 22000.318 / 22H2 19045.2965 / 21H2 19044.1288 / 21H1 19043.1348 / 20H2 19042.1052

::# uncomment to skip GUI dialog for MCT choice: 1507 to 11 23H2 - or rename script: "23H2 MediaCreationTool.bat"
rem set MCT=2310
::# uncomment to skip GUI dialog for MCT choice: 1507 to 11 25H2 - or rename script: "25H2 MediaCreationTool.bat"
rem set MCT=2510

::# uncomment to start auto upgrade setup directly (no prompts) - or rename script: "auto 11 MediaCreationTool.bat"
rem set /a AUTO=1
Expand Down Expand Up @@ -44,12 +46,12 @@ set OPTIONS=%OPTIONS% /Telemetry Disable /CompactOS Disable
::# comment to not unhide Enterprise for 1709+ in products.xml
set /a UNHIDE_BUSINESS=1

::# comment to not insert Enterprise esd links for 1607,1703 or update links for 1909,2004,20H2,21H2,22H2,11_21H2,11_22H2,11_23H2 in products.xml
::# comment to not insert Enterprise esd links for 1607,1703 or update links for 1909,2004,20H2,21H2,22H2,11_21H2,11_22H2,11_23H2,11_24H2,11_25H2 in products.xml
set /a INSERT_BUSINESS=1

::# MCT Version choice dialog items and default-index [11_23H2]
set VERSIONS=1507,1511,1607,1703,1709,1803,1809,1903,1909,20H1,20H2,21H1,21H2,22H2,11_21H2,11_22H2,11_23H2
set /a dV=17
::# MCT Version choice dialog items and default-index [11_25H2]
set VERSIONS=1507,1511,1607,1703,1709,1803,1809,1903,1909,20H1,20H2,21H1,21H2,22H2,11_21H2,11_22H2,11_23H2,11_24H2,11_25H2
set /a dV=19

::# MCT Preset choice dialog items and default-index [Select in MCT]
set PRESETS=^&Auto Upgrade,Auto ^&ISO,Auto ^&USB,^&Select,MCT ^&Defaults
Expand All @@ -66,7 +68,7 @@ set "OS_ARCH=x64" & if "%PROCESSOR_ARCHITECTURE:~-2%" equ "86" if not defined PR

::# parse MCT choice from script name or commandline - accepts both formats: 1909 or 19H2 etc.
for %%V in (1.1507 2.1511 3.1607 4.1703 5.1709 6.1803 7.1809 8.1903 8.19H1 9.1909 9.19H2 10.2004 10.20H1 11.2009 11.20H2 12.2104
12.21H1 13.2109 13.21H2 14.2210 14.22H2 15.2110 15.11_21H2 16.2209 16.11_22H2 17.2310 17.11_23H2) do for %%s in (%MCT% %~n0 %*) do if /i %%~xV equ .%%~s set "MCT=%%~nV" & set "VID=%%~s"
12.21H1 13.2109 13.21H2 14.2210 14.22H2 15.2110 15.11_21H2 16.2209 16.11_22H2 17.2310 17.11_23H2 18.2410 18.11_24H2 19.2510 19.11_25H2) do for %%s in (%MCT% %~n0 %*) do if /i %%~xV equ .%%~s set "MCT=%%~nV" & set "VID=%%~s"
if defined MCT if not defined VID set "MCT="

::# parse AUTO from script name or commandline - starts unattended upgrade / in-place repair / cross-edition
Expand Down Expand Up @@ -142,6 +144,18 @@ if %MCT%0 gtr 1 if %PRE%0 lss 1 call :choices PRE "%PRESETS%" %dP% "MCT Preset"
if %MCT%0 gtr 1 if %PRE%0 lss 1 goto choice-0 = cancel
goto choice-%MCT%

:choice-19
set "VER=26200" & set "VID=11_25H2" & set "CB=26200.7171.251111-1701.ge_release_svc_refresh" & set "CT=2025/11/" & set "CC=2.0"
set "CAB=https://download.microsoft.com/download/8e0c23e7-ddc2-45c4-b7e1-85a808b408ee/Products-Win11-24H2-6B.cab"
set "EXE=https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/mediacreationtool.exe"
goto process ::# windows 11 25H2 - 2025 Update with enablement package (uses 24H2 CAB as they share servicing branch)

:choice-18
set "VER=26100" & set "VID=11_24H2" & set "CB=26100.4349.250607-1500.ge_release_svc_refresh" & set "CT=2025/06/" & set "CC=2.0"
set "CAB=https://download.microsoft.com/download/8e0c23e7-ddc2-45c4-b7e1-85a808b408ee/Products-Win11-24H2-6B.cab"
set "EXE=https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/mediacreationtool.exe"
goto process ::# windows 11 24H2 - 2024 Update

:choice-17
set "VER=22631" & set "VID=11_23H2" & set "CB=22631.2861.231204-0538.23H2_ni_release_svc_refresh" & set "CT=2023/12/" & set "CC=2.0"
set "CAB=https://download.microsoft.com/download/6/2/b/62b47bc5-1b28-4bfa-9422-e7a098d326d4/products_win11_20231208.cab"
Expand Down Expand Up @@ -362,6 +376,8 @@ if %VER% geq 22000 (set MEDIA_ARCH=x64& if defined ARCH set ARCH=x64)
if %VER% geq 22000 (set X=11& set VIS=21H2) else (set X=10& set VIS=%VID%)
if %VER% geq 22621 (set X=11& set VIS=22H2)
if %VER% geq 22631 (set X=11& set VIS=23H2)
if %VER% geq 26100 (set X=11& set VIS=24H2)
if %VER% geq 26200 (set X=11& set VIS=25H2)

::# refresh screen
cls & <"%~f0" (set /p _=&for /l %%s in (1,1,20) do set _=& set/p _=& call echo;%%_%%)
Expand Down Expand Up @@ -673,7 +689,8 @@ pushd "%dir%sources" || (echo "%dir%sources" not found! script should be run fro
::# start sources\setup if under winpe (when booted from media) [Shift] + [F10]: c:\auto or d:\auto or e:\auto etc.
reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinPE">nul 2>nul && (
for %%s in (sCPU sRAM sSecureBoot sStorage sTPM) do reg add HKLM\SYSTEM\Setup\LabConfig /f /v Bypas%%sCheck /d 1 /t reg_dword
start "WinPE" sources\setup.exe & exit /b
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\HwReqChk" /f /v HwReqChkVars /t REG_MULTI_SZ /d "SQ_SecureBootCapable=TRUE\0SQ_SecureBootEnabled=TRUE\0SQ_TpmVersion=2\0SQ_RamMB=8192" /reg:64
start "WinPE" sources\setup.exe & exit /b
)

::# init variables
Expand Down Expand Up @@ -755,9 +772,10 @@ reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f /v DisableWU
::# prevent usage of MCT for intermediary upgrade in Dynamic Update (causing 7 to 19H1 instead of 7 to 21H2 for example)
if "%Build%" gtr "15063" (set OPTIONS=%OPTIONS% /UpdateMedia Decline)

::# skip windows 11 upgrade checks: add launch option trick if old-style 0-byte file trick is not on the media
::# skip windows 11 upgrade checks: add launch option trick if old-style 0-byte file trick is not on the media
if "%Build%" lss "22000" set /a SKIP_11_SETUP_CHECKS=0
reg add HKLM\SYSTEM\Setup\MoSetup /f /v AllowUpgradesWithUnsupportedTPMorCPU /d 1 /t reg_dword >nul 2>nul &rem ::# TPM 1.2+ only
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\HwReqChk" /f /v HwReqChkVars /t REG_MULTI_SZ /d "SQ_SecureBootCapable=TRUE\0SQ_SecureBootEnabled=TRUE\0SQ_TpmVersion=2\0SQ_RamMB=8192" /reg:64 >nul 2>nul &rem ::# 24H2/25H2 bypass
if "%SKIP_11_SETUP_CHECKS%" equ "1" cd.>appraiserres.dll 2>nul & rem ::# writable media only
for %%A in (appraiserres.dll) do if %%~zA gtr 0 (set TRICK=/Product Server ) else (set TRICK=)
if "%SKIP_11_SETUP_CHECKS%" equ "1" (set OPTIONS=%TRICK%%OPTIONS%)
Expand Down Expand Up @@ -827,15 +845,35 @@ function WIM_INFO ($file = 'install.esd', $index = 0, $out = 0) { :info while ($
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
<RunSynchronous>
<!-- offline local account via OOBE\BYPASSNRO on every site but literally no one credits AveYo for sharing it -->
<!-- bypass TPM, Secure Boot, RAM, CPU, and Storage checks for Windows 11 24H2/25H2 -->
<RunSynchronousCommand wcm:action="add"><Order>1</Order>
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t reg_dword /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add"><Order>2</Order>
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t reg_dword /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add"><Order>3</Order>
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t reg_dword /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add"><Order>4</Order>
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassCPUCheck /t reg_dword /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add"><Order>5</Order>
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassStorageCheck /t reg_dword /d 1 /f</Path>
</RunSynchronousCommand>
<!-- additional bypass for Windows 11 24H2/25H2 -->
<RunSynchronousCommand wcm:action="add"><Order>6</Order>
<Path>reg add HKLM\SYSTEM\Setup\MoSetup /v AllowUpgradesWithUnsupportedTPMorCPU /t reg_dword /d 1 /f</Path>
</RunSynchronousCommand>
<!-- offline local account via OOBE\BYPASSNRO on every site but literally no one credits AveYo for sharing it -->
<RunSynchronousCommand wcm:action="add"><Order>7</Order>
<Path>reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE /v BypassNRO /t reg_dword /d 1 /f</Path>
</RunSynchronousCommand>
<!-- hide unsupported nag on update settings - 25H1 is not a typo ;) -->
<RunSynchronousCommand wcm:action="add"><Order>2</Order>
<RunSynchronousCommand wcm:action="add"><Order>8</Order>
<Path>reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetReleaseVersion /d 1 /t reg_dword /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add"><Order>3</Order>
<RunSynchronousCommand wcm:action="add"><Order>9</Order>
<Path>reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetReleaseVersionInfo /d 25H1 /f</Path>
</RunSynchronousCommand>
</RunSynchronous>
Expand Down
49 changes: 33 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
Not just an Universal MediaCreationTool wrapper script with ingenious support for business editions,
<img src="preview.png">
A powerful yet simple windows 10 / 11 deployment automation tool as well!
*If you had no success launching the script so far, this latest version will work*
Not just an Universal MediaCreationTool wrapper script with ingenious support for business editions,
<img src="preview.png">
A powerful yet simple windows 10 / 11 deployment automation tool as well!
*If you had no success launching the script so far, this latest version will work*

**Now supports Windows 11 24H2 and 25H2 with enhanced TPM bypass!**

Presets
-------
1 ***Auto Upgrade*** with detected media, script assists setupprep for upgrading directly
> _- can keep files and apps on more scenarios where os and target edition does not match_
> _- can switch detected edition by adding EditionID to script name_
> _- can troubleshoot upgrade failing by adding `no_update` to script name_
> _- auto defaults to 11, so pass version as well for 10: `auto 21H2 MediaCreationTool.bat`_
> _- auto defaults to 11 25H2, so pass version as well for 10: `auto 21H2 MediaCreationTool.bat`_

2 ***Auto ISO*** with detected media in current folder directly _(or C:\ESD if run from zip)_
> _- can override detected media by adding edition name / language / arch to script name_
> _- example: `21H1 Education en-US x86 iso MediaCreationTool.bat`_
2 ***Auto ISO*** with detected media in current folder directly _(or C:\ESD if run from zip)_
> _- can override detected media by adding edition name / language / arch to script name_
> _- example: `24H2 Education en-US x64 iso MediaCreationTool.bat`_

3 ***Auto USB*** with detected media in specified usb target
> _- for data safety, this is not fully automated - must select the usb drive manually in GUI_
Expand All @@ -24,14 +26,18 @@ Presets
5 ***MCT Defaults*** runs unassisted, creating media without script modification
> _- no added files, script passes `products.xml` to MCT and quits without touching media_

1-4 presets will modify created media in the following ways:
> _- write `auto.cmd` to run on demand for auto upgrade with edition switch and skip tpm_
> _- write `$ISO$` folder content (if it exists) at the root of the media_
> _if you previously used $OEM$ content, must now place it in `$ISO$\sources\$OEM$\`_
> _- write `sources\PID.txt` to preselect edition at media boot or within windows (if configured)_
> _- write `sources\EI.cfg` to prevent product key prompt on Windows 11 consumer media (11 only)_
> _- write `AutoUnattend.xml` in boot.wim to enable local account on Windows 11 Home (11 only)_
> _- patch `winsetup.dll` in boot.wim to remove windows 11 setup checks when booting from media (11 only)_
1-4 presets will modify created media in the following ways:
> _- write `auto.cmd` to run on demand for auto upgrade with edition switch and skip tpm_
> _- write `$ISO$` folder content (if it exists) at the root of the media_
> _if you previously used $OEM$ content, must now place it in `$ISO$\sources\$OEM$\`_
> _- write `sources\PID.txt` to preselect edition at media boot or within windows (if configured)_
> _- write `sources\EI.cfg` to prevent product key prompt on Windows 11 consumer media (11 only)_
> _- write `AutoUnattend.xml` in boot.wim to enable local account on Windows 11 Home (11 only)_
> _- **Enhanced TPM/hardware bypass** for Windows 11 24H2/25H2 with multiple bypass layers:_
> - _Registry-based bypasses (LabConfig, HwReqChk, MoSetup)_
> - _appraiserres.dll bypass_
> - _winsetup.dll patching in boot.wim_
> _- patch `winsetup.dll` in boot.wim to remove windows 11 setup checks when booting from media (11 only)_
> _- can disable by adding `def` to script name for a default, untouched MCT media_

Simple deployment
Expand Down Expand Up @@ -125,4 +131,15 @@ _We did it! We broke [the previous gist](https://git.io/MediaCreationTool.bat)_
2022.03.18: fix regression with Auto Upgrade; removed powershell -nop arg (issue #41); enhanced 11 AutoUnattend.xml
2022.03.20: stable - all issues ironed out; improved script ui; upgrade keeping files from Eval editions too
last squash I promise ;)
2025.11.22: Windows 11 24H2 and 25H2 support
24H2 build 26100.4349 (June 2025 refresh)
25H2 build 26200.7171 (November 2025 refresh)
Enhanced TPM/hardware bypass for 24H2/25H2 installations:
- Added HwReqChk registry spoofing for hardware capability checks
- Enhanced AutoUnattend.xml with comprehensive LabConfig bypasses
- Added multiple layers: BypassTPMCheck, BypassSecureBootCheck, BypassRAMCheck, BypassCPUCheck, BypassStorageCheck
- Added AllowUpgradesWithUnsupportedTPMorCPU for MoSetup compatibility
- Maintains all existing bypass mechanisms (appraiserres.dll, winsetup.dll patching)
- 25H2 uses 24H2 products.cab as both share the same servicing branch
Default version updated from 23H2 to 25H2
```