Windows 10 Pro – Export Image Split WIM (SWM) to WIM

Have you had it happen to you that you set out to perform a task but keep running into a wall?  A solid brick wall?

In my quest for creating a Windows image file (WIM) for Windows 10 Professional, to import into Microsoft Deployment Tools (MDT) 2013 Update 2, I spent days trying to perform what should have been a simple task.

The situation was this:

For a lab/ test environment I have two Dell All-in-One computers that I want to test an image on.  The PCs came with Windows 10 Pro 64 pre-installed.  I attempted to import Windows 10 Pro 64bit from Dell media DVD but it includes two Split WIM files (install.swm and install2.swm) instead of install.wim.  It turns out that .swm files are not supported in MDT 2013.  Thus, I set out to merge install.swm and install2.swm into install.wim.

It took countless failed attempts to finally get it to work.

dism /export-image /swmfile:install*.swm /sourceindex:1 /destinationimagefile:install.wim is what I found online to be the right command but it failed miserably with the following:

Error 87:

The Export-Image option is unknown.

That was when attempting to export the files on a Windows 7 machine.  Entering dism /? in the command line clued me in on the fact that the /Export-Image option was not available for whatever reason.

So I moved on to a Windows 8 machine.  The /Export-Image option worked but I was prompted with this:

The command-line is missing the /sourceimagefile option

So I spent what seemed like an eternity searching Google for answers but would stumble upon the same command line over and over:

dism /export-image /swmfile:install*.swm /sourceindex:1 /destinationimagefile:install.wim

I moved on to a Windows 10 machine thinking it mattered; it probably doesn’t.

…and again I tried…

dism /export-image /swmfile:install*.swm /sourceindex:1 /destinationimagefile:install.wim

…and was greeted with:

The command-line is missing the /sourceimagefile option

…so I tried..

dism /export-image /sourceimagefile:install*.swm /sourceindex:1 /destinationimagefile:install.wim

…but /sourceimagefile: does not allow for wild characters so that failed…and then I tried…

dism /export-image /sourceimagefile:install.swm /sourceindex:1 /destinationimagefile:install.wim

…and thought I had it figured out as it began the process but again failed miserably at the end with a different error message:

The specified image file did not contain a resource section

…and I was back to square one.

You know that increasingly upsetting feeling that you get after failing so many times?  And you are following the instructions to the tee but yet something is missing?  Then you recompose yourself and realize that this has been done before and thus you must be doing something wrong.

So I issued dism /export-image /? at the command prompt and stared at the results for several minutes…and then it dawned on me.

I did a Google search for /sourceimagefile: and /swmfile: and found this post.

DISM /Export-Image /SourceImageFile:C:\Temp\SP2Recovery\Source\install.swm /swmfile:C:\Temp\SP2Recovery\Source\install*.swm /SourceIndex:1 /DestinationImageFile:C:\Temp\SP2Recovery\Destination\install.wim

I took that example and modified it to look like this:

dism /export-image /sourceimagefile:install.swm /swmfile:install*.swm /sourceindex:1 /destinationimagefile:install.wim

…but first…

I copied both install.swm and install2.swm into a new folder called images, located in Documents folder.

At the command line I did this:

cd c:\users\administrator\documents\images

…to be in the same directory as the .swm files.

…Finally, running the following from an elevated command prompt:

dism /export-image /sourceimagefile:install.swm /swmfile:install*.swm /sourceindex:1 /destinationimagefile:install.wim

…and the magic happened, successfully exporting the two .swm files into one very large install.wim file I needed to import into MDT 2013 Update 2.