Knowledge - Details


DISM Tips (WIM vs ESD, LimitAccess, paths with spaces)
Date Added: 4/22/2017

NOTE: I spent a few hours on 6/17/2016 experimenting with this, and these are my results.  Microsoft may have fixed this by the time you are reading this.
----------------------------------------------------------------------------------

Your ISO or DVD containing the Windows 10 installer will either have install.wim or install.esd.  If it has the ESD file, DISM will NOT work with it.  DISM only works with the WIM file.  I have verified this with 4 different computers, all running the latest version of Windows 10 Pro on 6/17/2016.  I have links to the WIM version of the ISO on my website.

LimitAccess = This tells DISM to NOT try to download any files from Windows Update (though even without this parameter, it still doesn't use WU for me)

These commands all work fine:
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:\\fileserver\Windows10ISOExtracted\sources\install.wim:1
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:\\fileserver\Windows 10 ISO Extracted\sources\install.wim:1
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:\\fileserver\Windows 10 ISO Extracted\sources\install.wim:1
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:\\fileserver\Windows 10 ISO Extracted\sources\install.wim:1 /LimitAccess
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:\\fileserver\Windows 10 ISO Extracted\sources\install.wim:2 (yes, this worked to repair a Pro machine using a Home WIM image)

Things to notice about the above commands:
If your path has spaces, you can surround the path with quotes.
If the path lacks spaces, you don't need the quotes.
The WIM index (:1 or :2) can either be inside the quotes or outside.  It works fine either way.
DISM DOES work ok with network paths.  It does NOT require mapped drives or mounted ISOs on the local machine.

Update for Windows 10 1703:
DISM does not like the wim: part of the Source value anymore.
DISM /Online /Cleanup-Image /RestoreHealth /Source:\\fileserver\Windows 10 ISO Extracted\sources\install.wim:1

----------------------------------------------------------------------------------
To see all the help documentation, you have to add parameters and then add /? again

dism /?
dism /online /?
dism /online /cleanup-image /?

----------------------------------------------------------------------------------
REM Ideal commands to run in order (to shrink the image and repair any corruption):

REM First, create a report about the component store
Dism /Online /Cleanup-Image /AnalyzeComponentStore

REM Second, see if the component store is already flagged as damaged
Dism /Online /Cleanup-Image /CheckHealth

REM Third, if the component store is not flagged as damaged, then run a full scan to see if it is actually damaged
Dism /Online /Cleanup-Image /ScanHealth

REM Fourth, if the component store is now flagged as damaged, repair it
Dism /Online /Cleanup-Image /RestoreHealth

REM Now that the component store is repaired, work on shrinking it
REM remove any backup files created during the installation of a service pack.
Dism /Online /Cleanup-Image /SPSuperseded
REM clean up the superseded components and reduce the size of the component store
Dism /Online /Cleanup-Image /StartComponentCleanup
REM reset the base of superseded components, which can further reduce the component store size. WARNING: This prevents you from uninstalling any past updates.
Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase

REM finally, create a new report about the component store size
Dism /Online /Cleanup-Image /AnalyzeComponentStore

REM this is a good time to run the system file checker, since SFC uses files from the (freshly repaired) component store to replace any corrupt files it finds.
sfc /scannow
----------------------------------------------------------------------------------



Back to List

Disclaimer: Everything on this website is written for my own use. I disclaim any guarantees that the procedures and advice listed here are accurate, safe, or beneficial for anyone else. If you attempt to follow any procedures or advice shared here, you do it at your own risk. Part of IT work is knowing how to recover from problems.