Monday 29 June 2015

Converting install.esd.to install.wim

 "It's not what you look at that matters, it's what you see."

If you're like me, you have wondered what this strange install.esd file is that came with Windows 8.1 Update which was obtained via official channels. It replaces the install.wim that is usually found on Windows installation media.

(All actions were performed on a technician computer running Windows 10 Insider Preview x64 Pro En-US build number 10.0.10130)

Let's have a look by mounting the ISO.

This is the Windows 10 preview (10130).




As you'd expect, in the sources folder there are two WIM files install.wim and boot.wim

This is the Windows 8.1 Update Pro x64 En-US ISO, downloaded from Microsoft's website.



The install.wim has given way to an ESD file (install.esd), an Electronic Software Download (ESD).

The compression rate of the ESD files is even higher than the compression rate of WIM files using the /compress:max switch.

ESD files however, resists some operations like deployment using a WDS server. There is a need to convert the ESD file to a WIM file. 

There is approximately a ton of 3rd party tools out there just for that purpose, many of which sport a fancy GUI. I will demonstrate that none of these tools has its use, because we can do everything we need with dism.

 I created a work folder



C:\>md deplyoment8.1u
 
C:\>md deplyoment8.1u



C:\>cd deplyoment8.1u



C:\deplyoment8.1u>dir

 Volume in drive C has no label.

 Volume Serial Number is ***



 Directory of C:\deplyoment8.1u



06/30/2015  12:38 AM    <DIR>          .

06/30/2015  12:38 AM    <DIR>          ..

06/29/2015  09:57 PM       262,242,670 boot.wim

06/29/2015  09:58 PM     2,794,179,280 install.esd

               2 File(s)  3,056,421,950 bytes

               2 Dir(s)  197,991,677,952 bytes free



C:\deplyoment8.1u>

Time to see what is inside the WIM, ESD files.

 dism /Get-WimInfo /WimFile:boot.wim

Deployment Image Servicing and Management tool

Version: 10.0.10130.0



Details for image : boot.wim



Index : 1

Name : Microsoft Windows PE (x64)

Description : Microsoft Windows PE (x64)

Size : 1,207,581,322 bytes



Index : 2

Name : Microsoft Windows Setup (x64)

Description : Microsoft Windows Setup (x64)

Size : 1,309,445,510 bytes



The operation completed successfully.



C:\

 dism /Get-WimInfo /WimFile:install.esd

C:\deplyoment8.1u>dism /Get-WimInfo /WimFile:install.esd



Deployment Image Servicing and Management tool

Version: 10.0.10130.0



Details for image : install.esd



Index : 1

Name : Windows 8.1 Pro

Description : Windows 8.1 Pro

Size : 13,185,962,705 bytes



The operation completed successfully.



C:\deplyoment8.1u>

Conversion install.esd to install.wim

 dism /export-image /SourceImageFile:install.esd /SourceIndex:1 /DestinationImageFile:install.wim /Compress:max /CheckIntegrity
C:\deplyoment8.1u>dism /export-image /SourceImageFile:install.esd /SourceIndex:1 /DestinationImageFile:install.wim /Compress:max /CheckIntegrity

Deployment Image Servicing and Management tool
Version: 10.0.10130.0

Exporting image
[==========================100.0%==========================]
The operation completed successfully.

C:\deplyoment8.1u>


Behold the WIM file and its content


C:\deplyoment8.1u>dir

 Volume in drive C has no label.

 Volume Serial Number is ***



 Directory of C:\deplyoment8.1u



06/30/2015  01:05 AM    <DIR>          .

06/30/2015  01:05 AM    <DIR>          ..

06/29/2015  09:57 PM       262,242,670 boot.wim

06/29/2015  09:58 PM     2,794,179,280 install.esd

06/30/2015  01:01 AM     3,547,816,622 install.wim

               3 File(s)  6,604,238,572 bytes

               2 Dir(s)  194,344,812,544 bytes free



C:\deplyoment8.1u>

 dism /get-wiminfo /wimfile:install.wim
C:\deplyoment8.1u>dism /get-wiminfo /wimfile:install.wim

Deployment Image Servicing and Management tool
Version: 10.0.10130.0

Details for image : install.wim

Index : 1
Name : Windows 8.1 Pro
Description : Windows 8.1 Pro
Size : 13,185,962,705 bytes

The operation completed successfully.

C:\deplyoment8.1u>







23 comments:

  1. When running the command:

    C:\deplyoment8.1u>dism /Get-WimInfo /WimFile:install.esd

    I get the following message:

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385


    Error: 11

    An attempt was made to load a program with an incorrect format.

    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

    Any ideas what is wrong?

    Thanks

    ReplyDelete
    Replies
    1. You probably have the wrong version .wim or .esd or specified the wrong index

      Delete
  2. Thanks for the conversion detail from esd to wim - allowed me to complete the DISM restorehealth process. Not sure I'll end up where I need to go yet, but I'm closer. Thank you.

    ReplyDelete
  3. I got the error message too. I originally ran it from a command prompt and it appears the DISM version was 8.1. When I used the ADK Deployment and Imaging Environment command prompt (as Admin) it exported my Win 10 .esd.

    ReplyDelete
    Replies
    1. Thank you so much. I've been driving myself crazy trying to get this working and your comment saved me!

      Delete
    2. Thank you! Your post saved me from driving myself crazy! Running DISM from the ADK fixed Error 11 for me!

      Delete
    3. Still saving lives in 2019. Thank you!

      Delete
  4. I got the error message 740 . It says elevated permission is required to run dism. Use elevated command prompt to complete these tasks. Could you please tell me what the problem is.?

    ReplyDelete
    Replies
    1. run command prompt window as admin

      Delete
  5. For all you poor lost souls that keep trying to find a way to repair Windows 10, this blog was the starting point for me to actually get it done. I can't believe there are hundreds of web sites giving bad instructions on this, but here is the actual solution:
    Download the latest windows image with the Windows Media Creation Tool.
    (After some Windows Updates your original .win or .esd will not work for DISM anymore)
    Do an upgrade in place first if the following does not work without doing so.
    Extract .esd or .wim from .iso downloaded.
    Put .esd in root folder of C:
    Open command prompt as Administrator
    Navigate to C:\
    Run:
    dism /export-image /SourceImageFile:install.esd /SourceIndex:1 /DestinationImageFile:install.wim /Compress:max /CheckIntegrity
    Make a directory call test\offline in the root directory of C:
    copy .wim to c:\test\offline
    Run:
    dism /mount-wim /wimFile:c:\install.wim /index:1 /MountDir:c:\test\offline
    Run:
    Dism /Image:c:\test\offline /Cleanup-Image /RestoreHealth /Source:c:\test\offline
    Run:
    sfc /scannow
    You may need to boot into safe mode as Administrator to run
    sfc /scannow
    And you may need to run it multiple times.

    ReplyDelete
  6. I am one of the poor souls and agree that there are many websites giving poor instructions.
    My good news is that I have been able to convert my esd file to wim using your guidance.
    The bad news is that the mount instructions did not work with an error message.
    You have also not covered the need to show the index for the windows program that is being used e.g. index 1 for windows pro.
    Would you comment please

    ReplyDelete
    Replies
    1. Yes, I didn't cover some topics such as encrypted *.esd files and working with multiple images in one *.esd/*.wim file i.e. working with indexes.

      If you want to repair a Windows 10 installation, here is how you can do it without having to mount the *.wim file:

      Have the *.iso or *.wim file ready that matches your current Windows 10 build. Omitting the Technical Preview builds, you should have one of these builds: Jul 2015 release (10240), Nov 2015 build (10586) or the Jul 2016 “Anniversary Build” (14393)

      1 (Mount the *.iso and) know the location of your *.wim file

      2 Peek into the *.wim file to make sure you repair the Home edition the with Home edition image, Pro with Pro image and so on.
      dism /Get-WimInfo /wimfile:D:\sources\install.wim

      Index : 1
      Name : Windows 10 Pro

      Index : 2
      Name : Windows 10 Home

      3 Restore Health (here: Win 10 Pro): DISM /Online /Cleanup-Image /RestoreHealth /source:WIM:d:\Sources\Install.wim:1 /LimitAccess

      4 Make sure it really worked: DISM.exe /Online /Cleanup-image /Scanhealth

      5 Run up to two times: sfc /scannow

      Hope it helps!

      Delete
  7. Thank you for your guidance Ben. I have followed your guidance but I am sorry to say that I am still struggling.
    When I mount my ISO file I can only find an install.esd file but I used your previous guidance to convert it to .wim. However, I cannot mount this install.wim file and so first of all put it on a flash drive, ran your instructions (which did not work) and then moved it to my C Drive as DISM could not find the source file on the flassh drive or the C Drive.
    The image on my laptop is build 10586.545 whereas the only ISO file I can download from Microsoft is build 10586.0. The error I get is 0x800f081f Dism cannot find the source files. Is this because my build is .545 and the downloaded build is .0 ?

    ReplyDelete
    Replies
    1. Have you considered upgrading to the 1607 build first? It may solve your issue and it is the most recent Windows 10 build after all.

      You can download the *.iso file from here:

      https://www.microsoft.com/en-us/software-download/windows10ISO/

      This ISO comes with an install.wim file, so no esd-to-wim conversion is necessary if you still need to do a repair.

      If you can’t or won’t upgrade, or if you are perhaps in corporate or restricted environment, these tips may help with repairing your current Windows 10 build:

      * The build number of the ISO is always a zero after the decimal point whereas the build number of the current installation is the result of installing the xxxxx.0 build and applying the latest cumulative update. Repairing a 10586.545 build with a 10586.0 image is fine and you will probably not find an official download from Microsoft other than the 10586.0 build.

      * It is worth a try to work with a higher version of DISM than what comes with the Windows build you are working on. I use for example the Windows 10 Technical Preview DISM to work on a Windows 8 image in the above blog entry. In your case, I’d try to boot a 1607 install media to repair the 1511 build on the c:\ drive (using a 1511 install.wim of course).

      * DISM may be case sensitive when parsing the parameters. Try using Install.wim or install.wim depending on the actual file name.

      * DISM may not accept blank spaces in the path to the install.wim file. Place the install.wim on your disk accordingly.

      There may be some more advice in this discussion:
      https://social.technet.microsoft.com/Forums/windows/en-US/0edc3dbd-a96d-4f1b-ac49-c67216483793/dism-error-0x800f081f-and-sfc-failed-to-repair?forum=win10itprohardware

      I’d be interested in learning how you resolved it.

      Delete
  8. I did consider the upgrade and an icon has appeared on my desktop to allow this to happen. But I have read some reports that say that the 1607 build has more bugs in it than the original build. So to install a potentially "buggy" operating system over a corrupted one did seem to me to be a bit risky and might complcate matters further.
    I don't quite follow what you mean about booting a 1607 version to my 1511 operating system? using a 1511 install.wim?

    ReplyDelete
    Replies
    1. What I meant about booting a 1607 is:

      If you boot from a Windows 10 installation media, you can open a command prompt which will give you the DISM tool of that installation media.

      ( For the instructions see: http://www.tenforums.com/tutorials/2880-command-prompt-boot-open-windows-10-a.html )

      Then you could try to repair the Windows installation on c: drive using a 1511 version of install.wim (that is also on your c: drive) using the 1607 version of DISM.

      The 1607 DISM reports as

      "Deployment Image Servicing and Management tool

      Version: 10.0.14393.0"

      The idea is that a newer DISM version is potentially more capable and has less bugs that and older version.

      Delete
  9. OK thanks for the suggestion. I have downloaded it as an ISO file and will try the booting and then use the DISM commands as suggested previously.
    It is going to be a few days before I can attempt this

    ReplyDelete
  10. Burned to disk OK and booted up to command prompt OK. However, when I tried to use the Dism parameters I got the following:-

    Error 50
    DISM does not support servicing Windows PE with this /Online option
    As you probably know PE is the preinstalltion environment and is a cut down verion of the system and so I gues this method will not work - unless you know a way around it Ben?

    ReplyDelete
  11. Well would you believe it I finally got DISM to work and sfc to repair some files.
    There were several windows updates for version 1511 waiting for me an so I installed those. Tried to scan but still an error, another program was using the printer.
    I wondered if my windows update was corrupted and so carried out a troubleshoot repair.
    Then ran dism /Online /Cleanup-image /RestoreHealth

    And it completed OK!!
    Then ran sfc and it reported that it had found corrupt files and repaired them.Success!

    However the bad news is that I still cannot scan using HP Solution Centre. It still thinks there is another program using the printer/scanner

    ReplyDelete
  12. Worked like a charm man, thanks for this!

    ReplyDelete