Forum Discussion
MBR2GPT Disk layout validation failed
When i try to run
mbr2gpt /validate /disk:0 /allowFullOS
i get the following output
MBR2GPT: Attempting to validate disk 0
MBR2GPT: Retrieving layout of disk
MBR2GPT: Validating layout, disk sector size is: 512 bytes
Disk layout validation failed for disk 0
I read a bit about it, and it seems to not work because disk 0 isnt a system disk, but in my case it is.
I am using build 1709
109 Replies
- UmDaManCopper Contributor
Here is an easy fix it has worked for me every time. In the below example vol 2 was my boot drive:
DISKPART
list vol
sel vol 2
shrink desired=500Reboot, then run the validation check again.
You should no longer have an issue and should now be able to /convert. :)
- Kamma905Iron Contributor
Does this format partition and delete all data from it?
- mbrow700Copper ContributorOddly, apparently it worked I began getting this error after the MBR had been converted. When I checked in disk management the volume partition style was was GPT.
- JKnessary1220Copper ContributorThe MBR2GPT tool requires that the disk's partition layout meets specific requirements for the conversion to be successful. For example, there should be enough space at the beginning and end of the disk for the necessary GPT partitions. If the existing partitions do not meet these requirements, the conversion can fail.
- Little_JoeBronze Contributor
Have you tried to update your Win10 to 22H2 then retry it?
- dankieeCopper Contributor
Aaron B I also have this problem when trying to convert and don't know what to do. I'm not that much of a techy so I don't want to mess anything up, Is anyone able to help? here's what my Disk Management looks like and the error i get in the command prompt.
Disk Management:Error: MBR2GPT: Attempting to validate disk 1
MBR2GPT: Retrieving layout of disk
MBR2GPT: Validating layout, disk sector size is: 512 bytes
Cannot find OS partition(s) for disk 1 - Mr_GarrisonCopper Contributor
Aaron BLook at your "logs". That will tell you where the disk needs space. Refer to the previous page with all the instructions, where many people found the instructions worked perfectly for their situation too.
The responses from MBR2GPT don't provide the information you need to remedy the drive / space. The initial response from running the command only provides information in the "log" that will help. Review the log that corresponds with the time and dated you ran the last test.
The log will provide specific information about "why" the test failed, and it's usually because there is not enough space either in the beginning of the disk or at the end of the disk. Either way, the "volume" needs to be reduced. Once you do the "Shrink", you will need to run the MBR2GPT test again.
If the test tells you the drive still does not pass, look at the log again and see "why".
The point is this. It's the "log" that provides enough detail for you to know how to resolve the issue. Then refer to the previous page where I detailed the instructions of how to make the drive compliant and you should be good to go. - CHISPURCopper Contributor
hey,
Perhaps you could create a backup image of your OS drivehttps://pokkesaves.net/The conversion shouldn't be affected by your recovery drive. The recovery partition only serves as a backup if your boot drive becomes corrupted.
- MousefluffIron Contributor
Last but not least, an x86 (32-bit) WinPE ISO creation script / batch file for MBR2GPT tasks, or other things like that. These all use the latest ADK. I also did not find any big issues so far. For the ARM / ARM64 images, there was only a single bootloader available unfortunately (which probably doesn't matter.) This seems like a recurring issue btw, which is why it may look like I'm necroing an old post (I'm just updating this to make the same problem a lot easier to solve in 2022.) This and the 64-bit one both have MBR and UEFI bootloaders on the same image. There is only a choice of UEFI with the ARM / ARM64 ones anyways. I would've customized them in the same way, but I don't think that even matters, given ARM PCs and embedded boards are relatively new. There would be no BSP files (Board Support Package files,) anyways if it didn't support it to begin with, so you would already KNOW what you were installing this on before you started (typically it's a tablet, a small server board, HTPC, or some type of newer SBC / Single Board Computer.) Feel free to edit these to your liking (add cumulative updates, power profiles and whatnot, etc.)
@ECHO OFF SETLOCAL REM NOTE: This could ONLY work when the ADK with the WinPE addon is ALREADY installed, and this batch file is run from the environment itself. REM NOTE: Some of the syntax / arguments have to be changed, such as the path for the USB Drive (if this is going to work properly.) REM NOTE: These 3 lines below show how to INSTALL the ADK and WinPE Addon first -> REM "Download the Windows ADK for Windows 11" -> https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install#download-the-adk-for-windows-11 REM "Download the Windows ADK for Windows 11" -> https://go.microsoft.com/fwlink/?linkid=2165884 REM "Download the Windows PE add-on for the ADK" -> https://go.microsoft.com/fwlink/?linkid=2166133 REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive#create-a-bootable-winpe-usb-drive REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-adding-powershell-support-to-windows-pe REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-optimize REM NOTE: Run this first from the "Deployment and Imaging Tools Environment" Command Prompt: copype X86 "C:\WinPE_X86_PS" REM ---------------------------------------------------------------------------------------------------- DISM /Mount-Image /ImageFile:"C:\WinPE_X86_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_X86_PS\mount" REM NOTE: "By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512." REM DISM /Set-ScratchSpace:64 /Image:"C:\WinPE_X86_PS\mount" MKDIR "C:\Scritch_Scratch" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\lp.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Fonts-Legacy.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-FontSupport-WinRE.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WMI.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WMI_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-NetFx.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Scripting.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PowerShell.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-StorageWMI.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-DISMCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-DISMCmdlets_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-SecureBootCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-SecureStartup.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PlatformId.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WinReCfg.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WinReCfg_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-PPPoE.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-RNDIS.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-HTA.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-HTA_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-Dot3Svc.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-EnhancedStorage.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-FMAPI.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WDS-Tools.cab" DISM /Add-Package /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab" DISM /Cleanup-Image /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /StartComponentCleanup /ResetBase REM NOTE: The following requires: "Sysinternals Suite" -> https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite COPY "C:\SysinternalsSuite\Sdelete.exe" "C:\WinPE_X86_PS\mount\windows\system32" DISM /Image:"C:\WinPE_X86_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /Optimize-Image /Boot DISM /Unmount-Image /MountDir:"C:\WinPE_X86_PS\mount" /Commit DISM /Cleanup-Mountpoints RMDIR /S /Q "C:\Scritch_Scratch" DISM /Export-Image /SourceImageFile:"C:\WinPE_X86_PS\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE_X86_PS\mount\boot2.wim" DEL "C:\WinPE_X86_PS\media\sources\boot.wim" COPY "C:\WinPE_X86_PS\mount\boot2.wim" "C:\WinPE_X86_PS\media\sources\boot.wim" DEL "C:\WinPE_X86_PS\mount\boot2.wim" REM NOTE: The following can only be run from the "Deployment and Imaging Tools Environment" Command Prompt: REM NOTE: Choose one or the other below, pick whatever output directory and name works: REM MakeWinPEMedia /ISO C:\WinPE_x86_PS C:\WinPE_X86_PS\WinPE_X86_PS.iso REM MakeWinPEMedia /UFD C:\WinPE_x86_PS G: REM oscdimg -m -o -u1 -udfver102 -lWIN_PE_X86 -bootdata:2#p0,e,b"C:\WinPE_X86_PS\fwfiles\etfsboot.com"#pEF,e,b"C:\WinPE_X86_PS\fwfiles\efisys.bin" "C:\WinPE_X86_PS\media" "C:\ISO\WinPE_English_x86.iso"
- MousefluffIron Contributor
More WinPE ISO creation batch files for MBR2GPT usage in a similar vein (ARM64, ARM.)
@ECHO OFF SETLOCAL REM NOTE: This could ONLY work when the ADK with the WinPE addon is ALREADY installed, and this batch file is run from the environment itself. REM NOTE: Some of the syntax / arguments have to be changed, such as the path for the USB Drive (if this is going to work properly.) REM NOTE: These 3 lines below show how to INSTALL the ADK and WinPE Addon first -> REM "Download the Windows ADK for Windows 11" -> https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install#download-the-adk-for-windows-11 REM "Download the Windows ADK for Windows 11" -> https://go.microsoft.com/fwlink/?linkid=2165884 REM "Download the Windows PE add-on for the ADK" -> https://go.microsoft.com/fwlink/?linkid=2166133 REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive#create-a-bootable-winpe-usb-drive REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-adding-powershell-support-to-windows-pe REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-optimize REM NOTE: Run this first from the "Deployment and Imaging Tools Environment" Command Prompt: copype ARM64 "C:\WinPE_ARM64_PS" REM ---------------------------------------------------------------------------------------------------- DISM /Mount-Image /ImageFile:"C:\WinPE_ARM64_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_ARM64_PS\mount" REM NOTE: "By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512." REM DISM /Set-ScratchSpace:512 /Image:"C:\WinPE_ARM64_PS\mount" MKDIR "C:\Scritch_Scratch" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\lp.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-Fonts-Legacy.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-FontSupport-WinRE.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-WMI.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-NetFx.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-Scripting.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-PowerShell.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-StorageWMI.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-DISMCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-DISMCmdlets_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-SecureBootCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-SecureStartup.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-PlatformId.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-WinReCfg.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-WinReCfg_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-PPPoE.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-RNDIS.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-Dot3Svc.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-EnhancedStorage.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-FMAPI.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-PmemCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-PmemCmdlets_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\WinPE-WDS-Tools.cab" DISM /Add-Package /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab" DISM /Cleanup-Image /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /StartComponentCleanup /ResetBase REM NOTE: The following requires: "Sysinternals Suite for ARM64" -> https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite COPY "C:\SysinternalsSuite\Sdelete64a.exe" "C:\WinPE_ARM64_PS\mount\windows\system32" DISM /Image:"C:\WinPE_ARM64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /Optimize-Image /Boot DISM /Unmount-Image /MountDir:"C:\WinPE_ARM64_PS\mount" /Commit DISM /Cleanup-Mountpoints RMDIR /S /Q "C:\Scritch_Scratch" DISM /Export-Image /SourceImageFile:"C:\WinPE_ARM64_PS\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE_ARM64_PS\mount\boot2.wim" DEL "C:\WinPE_ARM64_PS\media\sources\boot.wim" COPY "C:\WinPE_ARM64_PS\mount\boot2.wim" "C:\WinPE_ARM64_PS\media\sources\boot.wim" DEL "C:\WinPE_ARM64_PS\mount\boot2.wim" REM NOTE: The following can only be run from the "Deployment and Imaging Tools Environment" Command Prompt: REM NOTE: Choose one or the other below, pick whatever output directory and name works: REM MakeWinPEMedia /ISO C:\WinPE_ARM64_PS C:\WinPE_ARM64_PS\WinPE_ARM64_PS.iso REM MakeWinPEMedia /UFD C:\WinPE_ARM64_PS G: REM oscdimg -m -o -u1 -udfver102 -lWIN_PE_ARM64 -pEF -b"C:\WinPE_ARM64_PS\fwfiles\efisys.bin" "C:\WinPE_ARM64_PS\media" "C:\ISO\WinPE_English_ARM64.iso"
ARM:
@ECHO OFF SETLOCAL REM NOTE: This could ONLY work when the ADK with the WinPE addon is ALREADY installed, and this batch file is run from the environment itself. REM NOTE: Some of the syntax / arguments have to be changed, such as the path for the USB Drive (if this is going to work properly.) REM NOTE: These 3 lines below show how to INSTALL the ADK and WinPE Addon first -> REM "Download the Windows ADK for Windows 11" -> https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install#download-the-adk-for-windows-11 REM "Download the Windows ADK for Windows 11" -> https://go.microsoft.com/fwlink/?linkid=2165884 REM "Download the Windows PE add-on for the ADK" -> https://go.microsoft.com/fwlink/?linkid=2166133 REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive#create-a-bootable-winpe-usb-drive REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-adding-powershell-support-to-windows-pe REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-optimize REM NOTE: Run this first from the "Deployment and Imaging Tools Environment" Command Prompt: copype ARM "C:\WinPE_ARM_PS" REM ---------------------------------------------------------------------------------------------------- DISM /Mount-Image /ImageFile:"C:\WinPE_ARM_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_ARM_PS\mount" REM NOTE: "By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512." REM DISM /Set-ScratchSpace:64 /Image:"C:\WinPE_ARM_PS\mount" MKDIR "C:\Scritch_Scratch" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\lp.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-Fonts-Legacy.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-FontSupport-WinRE.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-WMI.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-WMI_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-NetFx.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-Scripting.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-PowerShell.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-StorageWMI.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-DISMCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-DISMCmdlets_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-SecureBootCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-SecureStartup.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-PlatformId.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-WinReCfg.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-WinReCfg_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-PPPoE.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-RNDIS.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-Dot3Svc.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-EnhancedStorage.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-FMAPI.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\WinPE-WDS-Tools.cab" DISM /Add-Package /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab" DISM /Cleanup-Image /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /StartComponentCleanup /ResetBase DISM /Image:"C:\WinPE_ARM_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /Optimize-Image /Boot DISM /Unmount-Image /MountDir:"C:\WinPE_ARM_PS\mount" /Commit DISM /Cleanup-Mountpoints RMDIR /S /Q "C:\Scritch_Scratch" DISM /Export-Image /SourceImageFile:"C:\WinPE_ARM_PS\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE_ARM_PS\mount\boot2.wim" DEL "C:\WinPE_ARM_PS\media\sources\boot.wim" COPY "C:\WinPE_ARM_PS\mount\boot2.wim" "C:\WinPE_ARM_PS\media\sources\boot.wim" DEL "C:\WinPE_ARM_PS\mount\boot2.wim" REM NOTE: The following can only be run from the "Deployment and Imaging Tools Environment" Command Prompt: REM NOTE: Choose one or the other below, pick whatever output directory and name works: REM MakeWinPEMedia /ISO C:\WinPE_ARM_PS C:\WinPE_ARM_PS\WinPE_ARM_PS.iso REM MakeWinPEMedia /UFD C:\WinPE_ARM_PS G: REM oscdimg -m -o -u1 -udfver102 -lWIN_PE_ARM -pEF -b"C:\WinPE_ARM_PS\fwfiles\efisys.bin" "C:\WinPE_ARM_PS\media" "C:\ISO\WinPE_English_ARM.iso"
- MousefluffIron Contributor
Here's a batch file I wrote that creates WinPE Installation media utilizing the latest Win11 ADK (which is very useful if you have to run MBR2GPT,) on your computer. You can also https://rufus.ie/downloads/ to use the ISO image created with this script to make a bootable USB drive with WinPE on it:
@ECHO OFF SETLOCAL REM NOTE: This could ONLY work when the ADK with the WinPE addon is ALREADY installed, and this batch file is run from the environment itself. REM NOTE: Some of the syntax / arguments have to be changed, such as the path for the USB Drive (if this is going to work properly.) REM NOTE: These 3 lines below show how to INSTALL the ADK and WinPE Addon first -> REM "Download the Windows ADK for Windows 11" -> https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install#download-the-adk-for-windows-11 REM "Download the Windows ADK for Windows 11" -> https://go.microsoft.com/fwlink/?linkid=2165884 REM "Download the Windows PE add-on for the ADK" -> https://go.microsoft.com/fwlink/?linkid=2166133 REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-create-usb-bootable-drive#create-a-bootable-winpe-usb-drive REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-adding-powershell-support-to-windows-pe REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize REM https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-optimize REM NOTE: Run this first from the "Deployment and Imaging Tools Environment" Command Prompt: copype AMD64 "C:\WinPE_amd64_PS" REM ---------------------------------------------------------------------------------------------------- DISM /Mount-Image /ImageFile:"C:\WinPE_AMD64_PS\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE_AMD64_PS\mount" REM NOTE: "By default, this is 512MB for PCs with more than 1GB of RAM, otherwise the default is 32MB. Valid values are 32, 64, 128, 256, or 512." REM DISM /Set-ScratchSpace:512 /Image:"C:\WinPE_AMD64_PS\mount" MKDIR "C:\Scritch_Scratch" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\lp.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Fonts-Legacy.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-FontSupport-WinRE.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFx.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Scripting.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PowerShell_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-StorageWMI.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-DISMCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-DISMCmdlets_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-SecureBootCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-SecureStartup.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PlatformId.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WinReCfg.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WinReCfg_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PPPoE.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PPPoE_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-RNDIS.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-HTA.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-HTA_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Dot3Svc.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-Dot3Svc_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-EnhancedStorage.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-EnhancedStorage_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-FMAPI.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PmemCmdlets.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-PmemCmdlets_en-us.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WDS-Tools.cab" DISM /Add-Package /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WDS-Tools_en-us.cab" DISM /Cleanup-Image /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /StartComponentCleanup /ResetBase REM NOTE: The following requires: "Sysinternals Suite" -> https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite COPY "C:\SysinternalsSuite\Sdelete64.exe" "C:\WinPE_AMD64_PS\mount\windows\system32" DISM /Image:"C:\WinPE_AMD64_PS\mount" /ScratchDir:"C:\Scritch_Scratch" /Optimize-Image /Boot DISM /Unmount-Image /MountDir:"C:\WinPE_AMD64_PS\mount" /Commit DISM /Cleanup-Mountpoints RMDIR /S /Q "C:\Scritch_Scratch" DISM /Export-Image /SourceImageFile:"C:\WinPE_AMD64_PS\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE_AMD64_PS\mount\boot2.wim" DEL "C:\WinPE_AMD64_PS\media\sources\boot.wim" COPY "C:\WinPE_AMD64_PS\mount\boot2.wim" "C:\WinPE_AMD64_PS\media\sources\boot.wim" DEL "C:\WinPE_AMD64_PS\mount\boot2.wim" REM NOTE: The following can only be run from the "Deployment and Imaging Tools Environment" Command Prompt: REM NOTE: Choose one or the other below, pick whatever output directory and name works: REM MakeWinPEMedia /ISO C:\WinPE_amd64_PS C:\WinPE_AMD64_PS\WinPE_AMD64_PS.iso REM MakeWinPEMedia /UFD C:\WinPE_amd64_PS G: REM oscdimg -m -o -u1 -udfver102 -lWIN_PE_X64 -bootdata:2#p0,e,b"C:\WinPE_AMD64_PS\fwfiles\etfsboot.com"#pEF,e,b"C:\WinPE_AMD64_PS\fwfiles\efisys.bin" "C:\WinPE_AMD64_PS\media" "C:\ISO\WinPE_English_x64.iso"
Misc:
"To Create a Windows Image for Multiple Architecture Types" -> https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/create-a-wim-for-multiple-architecture-types-using-dism#to-create-a-windows-image-for-multiple-architecture-types
"Oscdimg Command-Line Options" -> https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/oscdimg-command-line-options#file
"Create an ISO image for UEFI platforms for a Windows PE CD-ROM" -> https://docs.microsoft.com/en-US/troubleshoot/windows-server/deployment/create-iso-image-for-uefi-platforms
"Installing Windows to an EFI-Based Computer" -> https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/dd744321(v=ws.10)
"Device and OSDevice Settings" -> https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcd-system-store-settings-for-uefi#device-and-osdevice-settings
"Secure Boot" -> https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/secure-boot-landing