- SmartDeploy: Rethinking software deployment to remote workers in times of a pandemic - Thu, Jul 30 2020
- Outlook attachments now blocked in Office 365 - Tue, Nov 19 2019
- PolicyPak MDM Edition: Group Policy and more for BYOD - Tue, Oct 29 2019
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 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.
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.
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 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.
Read the latest IT news and community updates!
Join our IT community and read articles without ads!
Do you want to write for 4sysops? We are looking for new authors.
BTW, Windows 8.1 Update 3 is out for MSDN subs. But after a fresh install, you still have to perform 30+ updates.
Thanks! I am very glad that Microsoft is catching up on this. Hopefully, it will be extended to XP.
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?
I haven’t seen that one yet – within the same command prompt, can you browse to those files?
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
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?
Are you using express updates?
Remco, Joseph,
I downloaded the full cabs but now when I run the command it says “The system cannot find the file specified.”
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.
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.
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.
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
Good tip Gabriel!
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?
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.
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?
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.
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.
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
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
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.
They are starting to move that way now. I am hopeful that they will start releasing regularly updated WIMs for us to use.
Hi Andrew, Thank you for the info, the issue was with the index number being selecting, but all working now.
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
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?
Quick update, after waiting 10+ minutes… it finally resumed!
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