Not Found

The requested URL index.php was not found on this server.


Apache/2.2.22 (Linux) Server at Port 80
1 Multiple Windows 10 versions and editions in one WIM file – Win10.Guru
Go to ...

RSS Feed

Multiple Windows 10 versions and editions in one WIM file


DISM is maybe the most versatile and useful of all native Windows tools (a subjective personal opinion). In this post, I use it to create USB install media containing Pro and Enterprise editions of Windows 10 version 1903 (19H1), version 1909 (19H2), and Insider Preview build 19002. All three versions, a total of six editions, all belong to a single install.wim file.

Multilingual users can use the same method to create install media containing different language versions of Windows 10. For instance, I use it to create USB install media of official Windows 10 releases in Finnish, Swedish, English and German, all language versions  containing PRO, Education and Enterprise editions. This makes installing easy, and no third-party tools are required.

 Create a base WIM image

I use two folders for this project, ISO_Files which contains Windows 10 install files, and WIM to temporarily store the custom WIM file. Both folders are located on my D: drive.

Mounting a version 1903 ISO, I copy its contents to D:\ISO_Files folder. It is a multi edition ISO. I will start by checking the PRO and Enterprise edition index values with the following command from an elevated Command Prompt:

dism /Get-WimInfo /WimFile:D:\ISO_Files\Sources\install.wim

Click screenshots to open enlarged in a new tab.

Replace install.wim in previous command with install.esd, if you have created your ISO image using the Windows Media Creation Tool.

PRO is index 1, and Enterprise index 2. I will export the PRO edition to a new install.wim file to create a base WIM image, switch /SourceIndex:1 telling DISM which edition (PRO in this case) to export. In switch /DestinationName I tell DISM to label the first edition, index 1 in new base image as W10 PRO version 1903 :

Dism /Export-Image /SourceImageFile:D:\ISO_Files\Sources\install.wim /SourceIndex:1 /DestinationImageFile:D:\WIM\install.wim /DestinationName:"W10 PRO version 1903"

Again, replace install.wim in /SourceImageFile switch in previous command with install.esd, if you have created your ISO image using the Windows Media Creation Tool.

I repeat the previous command to add version 1903 Enterprise edition to the base image.

Add other versions

Adding version 1909 and Insider build 19002 PRO and Enterprise editions get done the same way. First, I mount the version 1909 multi-edition ISO, using virtual DVD drive letter K:. and check the index values for PRO and Enterprise editions. I export the 1909 PRO edition with following command:

Dism /Export-Image /SourceImageFile:K:\Sources\install.wim /SourceIndex:1 /DestinationImageFile:D:\WIM\install.wim /DestinationName:"W10 PRO version 1909"

DISM checks the existing index values in my base WIM image before adding a new index (edition) to it. Because the base image already contains indexes 1 (1903 PRO) and 2 (1903 Enterprise), the 1909 PRO edition automatically gets index value 3. I repeat this same process to add 1909 Enterprise which will get index value 4, mount the Insider build 19002 ISO and export its PRO and Enterprise editions as indexes 5 and 6.

All done. I now have a single Windows 10 WIM image containing PRO and Enterprise editions of version 1903, version 1909, and Insider build 19002:

Create USB install media

Next, I will copy this new custom WIM image D:\WIM\install.wim to the D:\ISO_Files\Sources folder, replacing the original install.wim file:

If your install files in D:\ISO_Files folder were copied from a Windows Media Creation Tool ISO, just copy the new custom WIM image D:\WIM\install.wim to D:\ISO_Files\Sources folder, and delete D:\ISO_Files\Sources\install.esd file.

The FAT32 file system has a file size limit of 4 GB. My custom WIM file containing two editions of three different Windows 10 versions is too big to be copied to a FAT32 formatted USB flash drive:

NTFS allows files larger than 4 GB. Some myth busting: Even some distinguished IT pros and experts will tell you that you cannot boot from NTFS formatted install media. Please, believe me, it really is just a myth: nothing in the UEFI specifications prevents NTFS boot. Rather, the issue is that some manufacturers do not add the correct firmware drivers to their systems. All modern UEFI based devices can be booted from NTFS formatted USB media, subject to firmware containing correct drivers. For instance, all recent HP, Lenovo, Surface and Dell UEFI devices have no issues in booting from a single partition, NTFS formatted USB flash drive. However, it’s important to note that NTFS boot requires Secure Boot be disabled in UEFI settings.

The D:\ISO_Files folder now contains everything needed to create multi version and edition Windows 10 install media. If your devices cannot boot from NTFS, see this Win10.guru story to create your install USB flash drive: USB install media with WIM file larger than 4GB

If your devices are able to boot from NTFS, download the following PowerShell script from my OneDrive: W10USB_NTFS.ps1

As always when downloading a script, batch file, ZIP archive or executable, remember to unblock it first before using it!

Open the script in an elevated PowerShell ISE (File menu > Open) and minimize the script editor:

Press F5 to run the script, and follow its instructions. NTFS formatted USB flash drive install media will be created. When this process starts, you are shown a message about USB needing to be formatted. Ignore it: close by clicking Cancel. The script takes care of formatting the USB flash drive:

The script runs and creates the install media:

That’s it. You have now an NTFS formatted multi version and edition Windows 10 install media to install any of your selected Windows 10 versions and editions on any modern UEFI based device:

Kari

P.S. For those interested in checking the preceding PowerShell script before downloading it, click expand source below to show all 200+ lines of its instructions:

##########################################################
# Creating a bootable USB drive for installing Windows
# on UEFI / GPT systems
##########################################################

##########################################################
# Start by clearing the screen, tell user how to start 
##########################################################

cls
Write-Host
Write-Host ' Plug in a USB flash (thumb) drive, recommended'
Write-Host ' size (standard W10 install media) 10 GB or more.'
Write-Host  
Write-Host ' Notice: Remove all other USB flash drives'
Write-Host ' leaving only the one to be used connected.'
Write-Host  
Write-Host ' If more than 1 USB flash drives are connected'
Write-Host ' this process will fail.'
Write-Host  
Write-Host ' External USB hard disks may remain connected,'
Write-Host ' just remove all additional USB flash drives.'
Write-Host

##########################################################
# Pause to wait a key to be pressed, then check connected
# disks showing their name and ID asking user to select
# the USB flash drive to be used. Showing clear warning to
# user with magenta text color to be sure user understands
# risks involved, cleaning wrong disk will cause issues!
##########################################################

pause
cls
Write-Host
Write-Host 'Checking connected disks. This might take a while...'
Write-Host
Get-Disk | Format-Table Number, Friendlyname, HealthStatus, PartitionStyle,
            @{n='Size';e={[int]($_.Size/1GB)}}         
Write-Host                                                                        
Write-Host ' Above is a list of all your connected disks.'
Write-Host ' Size is given in full gigabytes (GB).'
Write-Host 
Write-Host ' Enter the Disk Number (left  column) for USB'
Write-Host ' flash (thumb) drive to be made as bootable'
Write-Host ' Windows install media.'
Write-Host 
Write-Host '############################################################' -ForeGround Magenta 
Write-Host '# Be extremely careful!                                    #' -ForeGround Magenta 
Write-Host '#                                                          #' -ForeGround Magenta 
Write-Host '# Selected disk will be wiped clean and formatted.         #' -ForeGround Magenta 
Write-Host '# Selecting wrong disk, you will lose any data on it.      #' -ForeGround Magenta 
Write-Host '#                                                          #' -ForeGround Magenta 
Write-Host '# Accidentally selecting disk containing Windows, you will #' -ForeGround Magenta 
Write-Host '# make it unbootable, in which case you will lose all your #' -ForeGround Magenta 
Write-Host '# installed software and personal user files and folders!  #' -ForeGround Magenta 
Write-Host '#                                                          #' -ForeGround Magenta 
Write-Host '# If you are unsure, press CTRL + C to abort now.          #' -ForeGround Magenta 
Write-Host '############################################################' -ForeGround Magenta 
Write-Host
 
##########################################################
# Getting the USB ID number from user, asking one more
# time if user is sure and wants to proceed. To avoid any
# liability issues, user is asked not only to press a key
# but clearly type YES. If a wrong disk fill be cleaned
# and formatted after this, it's caused by user not script
##########################################################

$USBNUMBER = Read-Host -Prompt ' Enter your selection, and press Enter'

cls
Write-Host                                                                        
Write-Host ' Are you sure?'
Write-Host  
Write-Host ' Selected disk will be completely wiped and formatted!'
Write-Host 
Write-Host ' Please type YES (not case sensitive) and press Enter'
Write-Host ' to confirm, any other key or string + Enter to exit.'
Write-Host
 
$AreYouSure = Read-Host -Prompt ' Type YES and press Enter to confirm'

    if ($AreYouSure -ne 'YES')
        {exit}

cls
Write-Host
Write-Host ' Wiping USB flash drive clean & formatting it'

Clear-Disk -Number $USBNUMBER -RemoveData
New-Partition -DiskNumber $USBNUMBER -UseMaximumSize -AssignDriveLetter 

$USBDrive = Get-WmiObject Win32_Volume -Filter "DriveType='2'"
$USBDrive = $USBDrive.DriveLetter

Format-Volume -NewFileSystemLabel "W10 USB" -FileSystem NTFS -DriveLetter $USBDrive.Trim(":", " ")

$USBDrive = ($USBDrive + '\')

##########################################################
# USB flash drive cleaned and formatted, asking user to
# mount ISO and enter its drive letter. Entered drive
# letter or path will be written to variable $ISOFolder
##########################################################

cls
Write-Host
Write-Host ' If creating a USB install media with original install files,' 
Write-Host ' right click a Windows 10 ISO image and select "Mount".'
Write-Host 
Write-Host ' When done, enter the drive letter of mounted ISO'
Write-Host ' below and press Enter to continue.'
Write-Host 
Write-Host ' If creating install media with a custom WIM image file,'
Write-Host ' copy the the contents of mounted ISO to a folder. Replace'
Write-Host ' original install.wim or install.esd in Sources subfolder'
Write-Host ' with the custom WIM file and press Enter to continue.'
Write-Host
Write-Host ' Examples:'
Write-Host ' - ISO mounted as drive F:, no additional content required, enter F'
Write-Host ' - ISO contents copied to "D:\ISO_Files", enter D:\ISO_Files'
Write-Host ' - ISO contents copied to "X:\MyStuff\ISO", enter X:\MyStuff\ISO' 
Write-Host
$ISOFolder = Read-Host -Prompt ' Enter path to source and press Enter'

##########################################################
# Check if path entered by user is a drive letter by
# checking its length. If length is a single character, 
# it is a drive letter for mounted ISO in which case we
# add a colon (:) to variable value, X becoming X:
##########################################################

if ($ISOFolder.length -eq 1)
    {$ISOFolder = $ISOFolder + ":"}

##########################################################
# Check if entered mounted ISO or path to folder contains
# \Sources\install.wim (or install.esd) file (single bit
# architecture ISO), or in case of dual architecture ISO
# if install.wim (or install.esd) file can be found either
# in \x86\Sources or \x64\Sources folder or both of them.
#
# If install.wim or install.esd file is not found, given
# mounted ISO or folder path does not contain valid 
# W10 install files in which case script is aborted.  
##########################################################

$WimCount = 0
if ((Test-Path $ISOFolder\Sources\install.wim) -or 
    (Test-Path $ISOFolder\x86\Sources\install.wim) -or
    (Test-Path $ISOFolder\x64\Sources\install.wim) -or
    (Test-Path $ISOFolder\Sources\install.esd) -or 
    (Test-Path $ISOFolder\x86\Sources\install.esd) -or
    (Test-Path $ISOFolder\x64\Sources\install.esd))
        {$WimCount = 1}        
    else 
        {
        cls
        Write-Host
        Write-Host ' No Windows 10 installation files found.'
        Write-Host ' Please check mounted ISO letter or path'
        Write-Host ' to folder containing installation files'
        Write-Host ' and run script again.'
        Write-Host
        Pause
        Exit
        }
        
##########################################################
# Copying ISO content to USB flash drive
##########################################################

cls
$Files = Get-ChildItem -Path $ISOFolder -Recurse
$FileCount = $Files.count
$i=0
Foreach ($File in $Files) {
    $i++
    Write-Progress -activity "Copying files to USB. Get a cup of java or shot of single malt, this will take a few minutes..." -status "$File ($i of $FileCount)" -percentcomplete (($i/$FileCount)*100)
    if ($File.psiscontainer) {$SourcefileContainer = $File.parent} else {$SourcefileContainer = $File.directory}
    $RelativePath = $SourcefileContainer.fullname.SubString($ISOFolder.length)
    Copy-Item $File.fullname ($USBDrive + $RelativePath) 
}

##########################################################
# Telling user a bootable USB flash drive has been created
# and showing "Free to share" plus credits
##########################################################

cls
Write-Host                                                                        
Write-Host ' Bootable NTFS formatted Windows 10 USB drive for'
Write-Host ' installing Windows 10 on UEFI / GPT computers created.'
Write-Host
Write-Host ' You are free to edit and share this script'
Write-Host ' as long as source is mentioned.'
Write-Host   
Write-Host ' More Windows 10 tips, tricks, videos & tutorials at'
Write-Host ' https://win10.guru & https://www.tenforums.com'
Write-Host  
Write-Host ' Script by Kari'
Write-Host ' - https://win10.guru'
Write-Host ' - TenForums.com/members/kari.html'
Write-Host ' - Twitter.com/KariTheFinn'
Write-Host ' - YouTube.com/KariTheFinn'
Write-Host 
Write-Host

Author: Kari Finn

A former Windows Insider MVP, Kari started in computing in the mid 80’s writing code for VAX / VMS systems. Since then, he’s worked in a variety of IT positions. He specializes in Windows image capture, customization, repair and deployment as well as Hyper-V virtualization. Kari is a proud Team Member at number #1 Windows site TenForums.com.

2 Responses “Multiple Windows 10 versions and editions in one WIM file”

  1. Toni Fasth
    October 23, 2019 at 19:16

    This is awesome! Thanks for sharing.

    • October 23, 2019 at 20:02

      You are welcome. Nice and fast method to create multi version / multi edition WIM image.

Leave a Reply