This one has been in my head since long time now and I can't formulate the right question on google to find myself an answer so I'll give it a try here.

It's about DISM and WIM Files (Windows Imaging Format)

My Install.Wim has for indexes :

1 Windows Server 2012 R2 SERVERSTANDARDCORE
2 Windows Server 2012 R2 SERVERSTANDARD
4 Windows Server 2012 R2 SERVERDATACENTER

What if I want to apply a change (adding a patch, adding a file, install a windows feature) to all 4 indexes at the same time ?

I currently mount each index at the time, apply my changes, commit my changes and then dismount the image and start over with the next index.

Is there a better way to do this ?


There is no direct way to do it in all indexes...

But you can make a trick based on : ( from Tarak Bhavsar )

 @echo off

 if exist %TEMP%\scm (RD %TEMP%\scm /S /Q)
 md %TEMP%\scm

 for /L %%A IN (1, 1, 25) Do (

 dism /Get-WimInfo /WimFile:h:\research\Win7\InstallWin7_aio\sources\install.wim /index:%%A > %TEMP%\scm\%%A.txt
 timeout 0 >nul
 Find /i "Error:" "%Temp%\scm\%%A.TXT" > nul && (
      set "Index=%%A"


 set /A Ti = %Index% - 1
 ECHO There are %Ti% number of indexes in the image.


Hope this will help you and others !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.