DISM can preload Windows Update packages into your images. This guide will show you how to use DISM to load updates and includes a nearly automated way to slipstream 100+ updates at once.
Avatar

Update: If you are looking for a way to download updates read this  and this new article explains how to slipstream updates with  PowerShell and SCCM.

If you have ever watched a fresh OS install download update after update, you understand how frustrating and time consuming it can be. There are several solutions that will ensure a new machine is completely patched before the end user even gets the machine. For example, MDT includes two separate tasks for updating a machine during a task sequence.

The Windows Update Task in a MDT Task Sequence can slow down imaging

The Windows Update Task in an MDT Task Sequence can slow down imaging.

Another common method is to load Windows Update packages into the MDT Deployment Workbench Packages container.

The downside to most methods is the increase in imaging times. When you are installing 150+ updates on a Windows 7 machine, things can slow down to a crawl.

One great alternative is to use DISM and the /add-package parameter. With DISM and a simple batch file, we can loop through Windows Update packages and apply them to our .WIM files. Let’s briefly cover DISM and prep our environment before jumping into the cooler stuff.

Using DISM to install Windows Update packages

Start by creating a folder in the root of C:\. Name the folder Mount. Next, launch an administrative command prompt (WIN + X, A for Windows 8+ machines) and execute DISM to see the list of available options and the proper syntax. If you have ADK installed, you can launch the Deployment and Imaging Tools Environment shortcut as an administrator. This is my preferred method.

Getting help with DISM is made easier with command prompt examples

Getting help with DISM is made easier with command prompt examples.

Your first step is to mount your OS install.wim file. If you are using MDT, this file is located in your DeploymentShare under Operating Systems\OS Name\sources\. At your administrative command prompt, type the following:

dism /mount-wim /wimfile:”D:\DeploymentShare\Operating System\Windows 7 SP1\Sources\install.wim” /mountdir:C:\Mount /index:1

When the WIM is mounted, you should be able to browse to C:\Mount and view the contents.

A mounted WIM within Windows Explorer. An OS within an OS

A mounted WIM within Windows Explorer. An OS within an OS.

To add a Windows update, type the following command:

dism /image:C:\Mount /add-package /packagepath:PATH-TO-UPDATE

Adding updates with the above command is almost as tedious as watching 150 of them install. In the past, I would head to the Windows Update catalog and download every update that was needed. Although I will still do this for some single updates, I use a faster method now.

The easier way to slipstream Windows updates

To use this method, you will need to set up a fresh machine and let it fully update. This has to be done for each OS that you deploy. Luckily, you will only have to do this one time. When your first machine is fully patched, head back to your administrative command prompt and type the following:

Start /w for /R \\UPDATEDMACHINE\C$\Windows\SoftwareDistribution\Download\ %f in (*.cab) do DISM /image:C:\Mount /add-package /packagepath:”%U”

Be sure to specify your machine’s name in the command. This will launch a new window where you can watch as each update is installed. Even though this part is automated, it will still take a while to complete (about an hour for my test VM).

DISM successfully adding Windows Updates to our WIM

DISM has successfully added Windows updates to our WIM.

Once you are at the return prompt in the second window, all available updates have been slipstreamed. Head back to your first command prompt and type:

Dism /unmount-wim /mountdir:C:\Mount /commit

At this point, DISM will apply the changes that you’ve made, save your image, and unmount it. Your local Mount folder should now be empty. To speed up this process on other operating systems, save the following commands in a batch file:

dism /mount-wim /wimfile:”D:\DeploymentShare\Operating System\Windows 7 SP1\Sources\install.wim” /mountdir:C:\Mount /index:1
Start /w for /R \\UPDATEDMACHINE\C$\Windows\SoftwareDistribution\Download\ %f in (*.cab) do DISM /image:C:\Mount /add-package /packagepath:”%U”
Dism /unmount-wim /mountdir:C:\Mount /commit

Deploy your fully patched image to a test computer. Once the install finishes, check Windows Updates for any available updates. You should notice a drastic reduction! In my case, only updates that install with an EXE were still available. From here, you can deploy those remaining updates with WSUS or MDT Applications, or you can allow the Windows Updates task to finish the job.

Update: If you are looking for a way to download updates read this  and this new article explains how to slipstream updates with  PowerShell and SCCM.

155 Comments
  1. Avatar
    Recep Baltaş 9 years ago

    BTW, Windows 8.1 Update 3 is out for MSDN subs. But after a fresh install, you still have to perform 30+ updates.

    • Avatar Author

      Thanks! I am very glad that Microsoft is catching up on this. Hopefully, it will be extended to XP.

  2. Avatar
    William Petti 9 years ago

    I was able to download the Windows Update .msu’s and extracted the full cabs.

    Whenever I run this command I get the error. The system cannot find the file specified.

    Has anyone run into this?

    • Avatar Author

      I haven’t seen that one yet – within the same command prompt, can you browse to those files?

  3. Avatar
    William Petti 9 years ago

    Joseph,

    I can browse to those files. This is the command I’m running.

    C:\Windows\system32>Start /w for /R \\n32605\C$\Windows\SoftwareDistribution\Dow
    nload\ %f in (*.cab) do DISM /image:C:\Mount /add-package /packagepath:%f

  4. Avatar
    Remco 9 years ago

    Joseph,

    I have the same problem as William, when I run the command the packages return an error around 60%. Not all of them but the most of them fail. Any idea?

  5. Avatar Author

    Are you using express updates?

  6. Avatar
    William 9 years ago

    Remco, Joseph,

    I downloaded the full cabs but now when I run the command it says “The system cannot find the file specified.”

  7. Avatar
    Remco 9 years ago

    Joseph,

    Done it like you explained. Installed windows 8.1 and got the updates through windows update, installed them used this command.

    Start /w for /R \\UPDATEDMACHINE\C$\Windows\SoftwareDistribution\Download\ %f in (*.cab) do DISM /image:C:\Mount /add-package /packagepath:”%f”

    When I look into the Softwaredistribution folder I see the cabs. So do not really know what you mean by express updates.

  8. Avatar Author

    William: Your problem sounds like a permissions issue. Can you run the command on the machine that you are pulling the updates from? If you can, run it as the local administrator and move the WIM to a local folder.

  9. Avatar Author

    Remco: Get the KB number of an update that is failing. Then go to http://catalog.update.microsoft.com/v7/site/Home.aspx and download that update. See if you can import just that one update into a WIM.

  10. Avatar
    Gabriel Clifton 9 years ago

    On adding update packages, I use this to sort the updates based on date instead of for /r
    for /f %%f in (‘dir /b /o:d

  11. Avatar Author

    Good tip Gabriel!

  12. Avatar
    Jorge 9 years ago

    Great article! But i have a problem: I slipstreamed successfully about 150 updates but when I try the new ISO in a VM, then freshly-installed Windows 7 prompts to install all updates again! What am I doing wrong?

  13. Avatar Author

    Hi Jorge – it sounds like one of two problems to me. I would rerun the slipstream and save the command output to a text file. When you do this, make sure that each update is actually loaded into the WIM. Then make sure that the WIM successfully commits and saves the changes.

  14. Avatar
    William 9 years ago

    Whenever I run DISM, I can mount the WIM, and then when I run the second step, “Start /w for /R [. . .]” the program will find the *.cab files, but will mostly stop at any where from 60-70% and throw out the error 0x800f0816. As far as I can tell, this is just another super generic Windows Update failure. Each of the updates will fail around the same percent, do you have any idea what could cause this or how to fix it?

  15. Avatar
    Mike 9 years ago

    Hi Joseph,

    I got the same issue like Jorge,
    I do a successful mount, then use cabs from wsusoffline which install successful (100% according to dism) in a proportion of ~75% out of ~187 cabs, some of them refuse to install because “they are not intended ….”, but that’s fine.
    Then, I integrate successful Intel chipset drivers.
    Then I do a successful unmount with commit.
    Use oscdimg.exe to get it back as .ISO
    Now, installing on a real machine is working fine except the fact that in “Windows Updates-> View update history” is blank and “Installed updates” has only 2 updates.
    Is weird because not even Intel drivers seem to install, which are 100% tested onto machine.
    Checking for updates will trigger almost the same number of updates as the original SP1 .iso
    Also my msdn w7x64sp1 .iso is 3.09GB and my slipstreamed .iso is 3.99GB.
    Before posting, I did this process twice with the same end result.

    PS. I would post dism log file but…. no option.

  16. Avatar Author

    Mike/William: I haven’t forgotten about your problem yet – I am working on an updated script and article now. It should be ready in the next week or so.

  17. Avatar
    San 9 years ago

    Hi,
    I have the same issues as Jorge “I slipstreamed successfully about 180 updates but when I tried the new ISO on a laptop, Windows 7 prompts to install all updates again!” I have gone through the DISM process 3 time each time being successful, but its still not working for me. I am updating the install.wim from an ISO downloaded from MS VLSM

  18. Avatar
    Andrew 9 years ago

    San, Mike and Jorge,

    Make sure the the index of the install.wim you are updating with DISM is the one you are actually installing.

    For example from my Windows 7 Ultimate iso:

    Details for image : c:\images/instal

    Index : 1
    Name : Windows 7 HOMEBASIC
    Description : Windows 7 HOMEBASIC
    Size : 11,710,161,360 bytes

    Index : 2
    Name : Windows 7 HOMEPREMIUM
    Description : Windows 7 HOMEPREMIUM
    Size : 12,222,587,449 bytes

    Index : 3
    Name : Windows 7 PROFESSIONAL
    Description : Windows 7 PROFESSIONAL
    Size : 12,122,886,417 bytes

    Index : 4
    Name : Windows 7 ULTIMATE
    Description : Windows 7 ULTIMATE
    Size : 12,285,492,779 bytes

  19. Avatar
    Mike 9 years ago

    Hi, Joseph, thank you for your reply.
    I thought that might be the issue.
    I did another slipstream in index:3 with updates provided by WUD (WUD provided more updates as .msu, which needed unpacking as .cab) this time, but I didn’t had the time to test it. I’ll be back with feedback 🙂
    If this was the issue, then I’m disappointed. I was hoping that all editions of windows would get updated.

    PS. Microsoft should have done this for all of us or get a Service Pack every 1-2 yrs.

  20. Avatar Author

    They are starting to move that way now. I am hopeful that they will start releasing regularly updated WIMs for us to use.

  21. Avatar
    San 9 years ago

    Hi Andrew, Thank you for the info, the issue was with the index number being selecting, but all working now.

  22. Avatar
    Benjmain 9 years ago

    I’m trying to do this for windows 7 x64 and keep getting the following

    Image Version: 6.1.7600.16385

    Processing 1 of 1 – Adding package Package_for_KB2861191~31bf3856ad364e35~amd64~
    ~6.1.1.0
    [===========================62.5%==== ]
    An error occurred – Package_for_KB2861191 Error: 0x800f0816

    Error: 0x800f0816

    DISM failed. No operation was performed.
    For more information, review the log file.

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

    C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment
    Tools>DISM /image:C:\Mount /add-package /packagepath:”\\carbontest\C$\Windows\S
    oftwareDistribution\Download\7f1b420097983fbb1f283b68f4f1779e\windows6.1-kb28932
    94-x64-express.cab”

    Deployment Image Servicing and Management tool
    Version: 6.3.9600.17029

    Image Version: 6.1.7600.16385

    Processing 1 of 1 – Adding package Package_for_KB2893294~31bf3856ad364e35~amd64~
    ~6.1.1.1
    [===========================63.2%==== ]
    An error occurred – Package_for_KB2893294 Error: 0x800f0816

    Error: 0x800f0816

    DISM failed. No operation was performed.
    For more information, review the log file.

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

    C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment
    Tools>DISM /image:C:\Mount /add-package /packagepath:”\\carbontest\C$\Windows\S
    oftwareDistribution\Download\81b80f6a81d826a058dde28ed40719e5\windows6.1-kb29849
    72-x64-express.cab”

    Deployment Image Servicing and Management tool
    Version: 6.3.9600.17029

  23. Avatar
    JF Martel 9 years ago

    Just did the whole thing. Awesome. It goes into Windows and the task sequence halt on the Windows Update process (Post-Application Installation) but does not continue…

    Am I missing something?

  24. Avatar
    JF Martel 9 years ago

    Quick update, after waiting 10+ minutes… it finally resumed!

  25. Avatar
    Dave 9 years ago

    Is this procedure vaild for every edition?
    I have an AIO .wim with all editions of Windows 7 x86.
    Can I use the same .cab for all editions?
    Thanks,
    Dave

Leave a reply

Please enclose code in pre tags

Your email address will not be published. Required fields are marked *

*

Š 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account