How to use DISM to install a hotfix from within Windows
#
#
#
How to use DISM to install a hotfix from within Windows
https://blogs.technet.microsoft.com/askcore/2011/02/15/how-to-use-dism-to-install-a-hotfix-from-within-windows/
February 15, 2011 by Jeff Hughes (MSFT) // 39 Comments
Hello, my name is Emmers Presson. I am a Support Escalation Engineer for Microsoft in the Windows Core team.
The purpose of this blog is to give you the steps to install a hotfix (or any other “package”) on the currently running operating system using the Deployment Image Servicing and Management (DISM) command. DISM is a new command-line tool that comes built-in for Windows 7 and Windows Server 2008 is the DISM tool. DISM combines the functions of multiple tools from the Windows Automated Installation Kit (WAIK) and allows users to perform multiple actions on operating system images. For the most part, this involves viewing and manipulating “offline images” which are in the Windows Imaging (WIM) file format. Here is a good reference that explains the function of the DISM tool and what the DISM tool is meant to replace:
http://windowsteamblog.com/windows/b/springboard/archive/2009/07/28/managing-windows-7-with-dism.aspx
There are also some DISM commands that target the running operating system (“online”). For example, you can use the following command to list the “packages” installed:
dism /online /get-packages /format:table
The command-line switch to install a package is “/Add-Package.” Let’s say that you are running Windows Server 2008 R2 Enterprise and you want to install the hotfix KB976571. When you download the hotfix file, the file name is “Windows6.1-KB976571-v2-x64.msu.” When you look at the DISM syntax in online help, you would assume that following syntax would work:
DISM.exe /Online /Add-Package /PackagePath\kb976571\Windows6.1-KB976571-v2-x64.msu
where the .MSU file is stored in the c:\kb976571 folder.
Here is the screenshot of the results:
You will see the following snippet if you review the file c:\windows\logs\dism\dism.log:
2010-09-02 20:33:58, Info DISM DISM Package Manager: PID=7116 Encountered the option “packagepath” with value “c:\kb976571\Windows6.1-KB976571-v2-x64.msu” – CPackageManagerCLIHandler::Private_GetPackagesFromCommandLine
2010-09-02 20:33:58, Error DISM DISM Package Manager: PID=7116 DISM does not support installing MSU files online. – CMsuPackage::Install(hr:0x80070032)
Based on these results, you may wonder if you can really install packages online and if so, what type of file must you use if you can’t use MSU files? The answer is found in defining what a Microsoft Update Standalone Package (MSU) file is and how you would do this in the previous command-line tool, Package Manager (Pkgmgr.exe).
You had to extract the contents of a MSU file and instead use the .CAB file of the package in order to install or uninstall using the Package Manager tool (http://support.microsoft.com/default.aspx?scid=kb;EN-US;940410).
So try this approach:
Create a c:\temp\976571 folder.
Use the following command to extract the contents of the MSU file:
Expand –F:* c:\kb976571\Windows6.1-KB976571-v2-x64.msu c:\temp\976571
This resulted in extracting multiple files, which included the Windows6.1-KB976571-v2-x64.cab file.
Now try the following command:
DISM.exe /Online /Add-Package /PackagePath\temp\976571\Windows6.1-KB976571-v2-x64.cab
This time I see the following:
Success!
You could tweak the command. For example, use the following syntax to install the package silently and avoid restarting Windows:
start /wait DISM.exe /Online /Add-Package /PackagePath\temp\976571\Windows6.1-KB976571-v2-x64.cab /Quiet /NoRestart
You could use a similar command to uninstall an update using DISM. Here’s the syntax for that:
DISM.exe /Online /Remove-Package /PackagePath\temp\976571\Windows6.1-KB976571-v2-x64.cab
I hope you find this helpful and explore other options for the DISM command-line tool.
Emmers Presson
Support Escalation Engineer
Microsoft Enterprise Platforms Support
Back to
top
Search this blog Search all blogs
Top Server & Tools Blogs
- ScottGu’s Blog
- Brad Anderson’s “In the Cloud” Blog
- Brian Harry’s Blog
- Steve “Guggs” Guggenheimer’s Blog
EPS Team Blogs
- ASK Perf Blog
Memory Management, Performance, Printing, Terminal Server - CPR / Escalation Services
Debugging, Hangs, Tools - Directory Services
DFSR, Certificates, Group Policy - LATAM [Portugese & Spanish]
Espanol, Portugues - Manageability
SMS MOM - Networking
Scalable Networking, OCS, Communications Server - Small Business Server
Windows Essential Business Server - SoftGrid
Microsoft Application Virtualization, SoftGrid, Softricity - Data Protection Manager (DPM)
DPM related issues - Microsoft Deployment Team Blog
BDD Team - Vista
Vista Team Blog - Microsoft GTSC Romania - Enterprise Platforms Support
Microsoft GTSC Bucharest / Covering topics such as: Windows Server, Failover Clustering, Performance, Printing, Core OS, AD, Deployment, WSUS, SCOM/SCCM
Product Team Blogs
- Virtualization
- DPM
- Clustering
- Windows Server
Recent Posts
- CROSSPOST: New Server Management Tool: Project Name “Honolulu” September 14, 2017
- High CPU/High Memory in WSUS following Update Tuesdays August 18, 2017
- Enabling Surface Laptop keyboard during MDT deployment August 18, 2017
- Deploy Windows from USB drive to Surface Studio June 14, 2017
Tags
Activation Backup/Restore Bitlocker Chris Butcher Chuck Timon Deployment Disaster Recovery DPM Failover Cluster Himanshu Singh Hyper-V James Burrage Jeff Hughes John Marlin Joseph Conway Keith Hill Manoj Sehgal MBAM (Microsoft BitLocker Administration and Monitoring) Mike Rosado Naziya Shaik Pages Performance Robert Mitchell Scott McArthur SCVMM Sean Dwyer Servicing Shannon Gowen Steven Graves Storage and File Storage and File Systems Surface Vic Reavis Vimal Shekar Windows 7 Windows 8 Windows 8.1 Windows 10 Windows 2012 Windows Server 2008 Windows Server 2008 R2 Windows Server 2012 Windows Server 2012 R2 Windows Server 2016 Windows Vista
Archives
- September 2017 (1)
- August 2017 (2)
- June 2017 (2)
- May 2017 (2)
- April 2017 (1)
- March 2017 (4)
- February 2017 (1)
- January 2017 (1)
- November 2016 (2)
- All of 2017 (14)
- All of 2016 (16)
- All of 2015 (25)
- All of 2014 (31)
- All of 2013 (43)
- All of 2012 (48)
- All of 2011 (45)
- All of 2010 (41)
- All of 2009 (63)
- All of 2008 (61)
- All of 2007 (8)
50 years ago
Anonymous
Thanks a lot. It helped me to install Win 8 Language Pack directly from CAB.
50 years ago
Pronichkin
Hi dj_palindrome,
What stops you from going the same approach with DISM?
Dism.exe /online /add-package /packagepath:”C:Usersi0028lDownloadsupdate-bf.mum”
This works perfectly for me.
50 years ago
OdgeUK
Please could you tell me how to uninstall a package installed in this way, if you no longer have the file in the Temp Directory?
50 years ago
Markus Ruppel
Emmers,
on Win 8.1 pro (running on a Surface Pro 3, updated with all available patches as of today), I execute the following command:dism /online /add-package /packagepath
name.cab
“Name.cab” had been downloaded directly from catalog.update.microsoft.com.
The output is:
…
Image Version: 6.3.9600.17031
An error occurred trying to open – c:sigtel.cab Error: 0x80070002
Error: 2
The system cannot find the file specified.
…
In dism.log I find:
Failed opening package. – CDISMPackageManager::Internal_CreatePackageByPath(hr:0x80070002)
Failed to get the underlying CBS package. – CDISMPackageManager::OpenPackageByPath(hr:0x80070002)Failed to open the package at location: “c:name.cab” –
http://blogs.technet.com/b/askcore/archive/2011/02/15/how-to-use-dism-to-install-a-hotfix-from-within-windows.aspx#CPackageManagerCLIHandler::ProcessPackagePath(hr:0x80070002)What would be the “underlying CBS package”?
Using DISM, I could verify that there is no component store corruption.Any help would be appreciated!
Thanks,
Markus Ruppel50 years ago
ThiloL
I get error (0x800f0902) (CBS busy) on sequenced DISM-calls. What could be the reason?
I cannot use “cmd.exe /c START /WAIT”, because I need the return values.
50 years ago
Pronichkin
@OdgeUK
Well, how about this?
.Dism.exe /Online /Remove-Package /PackageName:”Package_for_KB1234567~31bf3856ad364e35~amd64~~6.2.1.0”
The list of installed packages and their respective names can be obtained by running
.Dism.exe /Online /Get-Packages
50 years ago
Anonymous
Very clear post.
May I ask if it is possible through DISM (or through other tools) to list all files that are changed for an hotfix?
Many Thanks
50 years ago
dj_palindrome
Might I ask how to install LDR (QFE) hotfix service branches from the command line using DISM?
I’ll admit I’m afraid of DISM syntax, so I use something like “pkgmgr /ip /m:update-bf.mum /log:pkgmgr_x64” after expanding the CAB file inside the MSU package.
I know that the use of pkgmgr is deprecated and it is actually shimmed to call DISM. However even the DISM logs look scary ;-o
50 years ago
Pronichkin
Not with dism, but you can use standard “double expand” approach or a tool like CBS Package Inspector (archive.msdn.microsoft.com/packageinspector). The latter is designed specifically for Windows Embedded, but since the Component stack is the same, it works for regular Windows packages just fine.
50 years ago
Anonymous
Thanks a lot. It helped me to install Win 8 Language Pack directly from CAB.
50 years ago
Knuckle-Dragger
Thanks
50 years ago
Anonymous
Can we extract multiple MSU file to cab? I mean if you have 100 updates then you not need to write command 100 times.
9 years ago
Drewfus
Good rundown Emmers.
I’ve used this method to install IE offline, except that I point the PackagePath to the XML file (answerfile) in the expanded source. It works well. Fast and avoids a reboot.
Can you explain why OS service packs cannot be installed using MSU technology? That is, why can’t service packs be installed offline?
One more off topic question. DISM can do many imaging and deployment related tasks, except that it cannot create catalog (.clg) files. This prevents the entire build process being automated, as modifying an offline image would require a new catalog file be created. Any chance of a /make-catalog switch in a future DISM update?
8 years ago
Eduardo Oliveira
Very useful post. I had tried the same thing than you (just put .MSU in a folder and try to call DISM to install), but didn’t found the file. Now works fine after expanding.
Thanks.
6 years ago
Clampatron
For multiple MSUs
Download MSU files manually from microsoft download centre.
Extract the cab files using:
Expand -F:* [MSUs folder*] [CAB destination folder]
Install using DISM using:
DISM /online /add-package /packagepath:[CAB destination folder]
6 years ago
Metamorphosis
thanks a lot…
6 years ago
kdmilliken
I followed all the steps and I still get an error. I’m running a w2k8 r2 esx 5.1 vm receiving the scecli error event 1201 no mapping between account names error. Hotfix KB974639 is suppose to fix this. Its a .msu file. After following all of the above steps I receive an error 0x800f081e The specified package is not applicable to this image. Any ideas what I may have missed.
6 years ago
Apple xu
Clear and useful
Thanks.
6 years ago
Sonia Aguayo
How can I run to multiple machines? I tried to do a script but it dosn’t work because need elevated permission on Windows 7. I am stuck with that.
5 years ago
tahereh
HI I would like to update server Windows 2012 and download msu file of Microsoft AND I have no internet on server IM Type msu file > Expand –F:* c:kb976571Windows6.1-KB976571-v2-x64.msu c:temp976571 and type >> DISM.exe /Online /Remove-Package /PackagePath
temp976571Windows6.1-KB976571-v2-x64.cab
BUT Back to me ERROR
An error occurred trying to open -c:tempwindows6.1……..cab Error :0x800703075 years ago
tahereh
HI I would like to update server Windows 2012 and download msu file of Microsoft AND I have no internet on server IM Type msu file > Expand –F:* c:kb976571Windows6.1-KB976571-v2-x64.msu c:temp976571 and type >> DISM.exe /Online /Remove-Package /PackagePath
temp976571Windows6.1-KB976571-v2-x64.cab
BUT Back to me ERROR
An error occurred trying to open -c:tempwindows6.1……..cab Error :0x800703075 years ago
tahereh
HI I would like to update server Windows 2012 and download msu file of Microsoft AND I have no internet on server IM Type msu file > Expand –F:* c:kb976571Windows6.1-KB976571-v2-x64.msu c:temp976571 and type >> DISM.exe /Online /Remove-Package /PackagePath
temp976571Windows6.1-KB976571-v2-x64.cab
BUT Back to me ERROR
An error occurred trying to open -c:tempwindows6.1……..cab Error :0x800703075 years ago
tahereh
HI I would like to update server Windows 2012 and download msu file of Microsoft AND I have no internet on server IM Type msu file > Expand –F:* c:kb976571Windows6.1-KB976571-v2-x64.msu c:temp976571 and type >> DISM.exe /Online /Remove-Package /PackagePath
temp976571Windows6.1-KB976571-v2-x64.cab
BUT Back to me ERROR
An error occurred trying to open -c:tempwindows6.1……..cab Error :0x800703075 years ago
VijayPV
Hi Emmers.. I have another query.. I am trying to uninstall a patch from a 2008 server that has blue screened. I am using DISM /image with remove-package switch. Obviously i do this from recovery environment X:.. The command executes fine and i get 100%.
But after i reboot and use the get-packages command.. i see the patch is still there with a “pending install” comment. Can you advise some way to get the patch removed fully from recovery command prompt. Thanks in advance5 years ago
Greg Lambert
If the cab files all ready downloaded on a single computer, do you still need the /online switch to install the cab file? DISM.exe /Online /Add-Package /PackagePath
temp976571Windows6.1-KB976571-v2-x64.cab
5 years ago
Teddy
Do you have any ideas on how to improve the installation time of a batch of hotfixes?
I go from just 50 minutes to 3 hrs with the all the new hotfixes.
thank you,
Teddy5 years ago
P4
Hello. Great article indeed clean and straight forward, however I have exactly the same problem as reported by Markus Ruppel on 19 Nov 2014 11:36 PM.
I’m trying to install Windows6.1-KB958559-x64-RefreshPkg.msu on my Windows Technical Preview Build 9860. After expanding the msu package and invoking DISM.exe /Online /Add-Package /PackagePath:Windows6.1-KB958559-x64-RefreshPkg.cab I receive an error: The implementation
is not capable of performing the request. Looking into dism.log and then CBS.log I can read the following errors that occured:
http://pastebin.com/w0XqVvinWould you be so kind to comment on the above, please?
How to successfully install the package downloaded from
http://www.microsoft.com/en-US/download/details.aspx?id=3702 on my machine?After running Windows6.1-KB958559-x64-RefreshPkg.msu directly I get Windows Update Standalone Installer error of 0x80096002: The certificate for the signer of the message is invalid or not found thus I followed your post.
Running havdetectiontool.exe in Windows 7 compatibility mode brings me information that Hardware-Assisted Virtualization is not available on my box but I don’t think it is a reason of described problem. VMWare Worksation 9 and 10 had no issues running on this
hardware.4 years ago
Anish
Thanks for useful info.
How you deal with lot of updates in CAB file and inside numerous different folders?
I ‘m trying to use using Recurse and other bits but no avail
C:TempOfflineUpdates>Dism /Online /Add-Package /PackagePath:”C:TempSoftwareU
pdates2015” /IgnoreCheckDeployment Image Servicing and Management tool
Version: 6.1.7600.16385Image Version: 6.1.7601.18489
An error occurred trying to open – C:TempSoftwareUpdates2015” /IgnoreCheck Err
or: 0x80070003Error: 3
The system cannot find the path specified.
Any suggestions?
Thanks in advance
Regards
Anish
4 years ago
fullflash
Many thanks!
I have use many method to install a fix , and it’s the only one which worked for me!4 years ago
Jimm
Why not just use WUSA to install the MSU files?
3 years ago
john
WUSA Its slooow. DISM just inject the update.
4 years ago
Help
Error: 2
The system cannot find the file specified.I know I’m typing the path correctly…
4 years ago
Tim
Thanks, I found this very helpful. I Struggled with installing a patch for most of the day until I found this post.
3 years ago
Graham Ansell
Thanks for the great tips
3 years ago
ash
This doesn’t work on Win 10 1607
All you get is error 872 years ago
john smith
tremendously helpful. may you live a long and happy life.
2 years ago
Ana Cummings
I have tried multiple times to do the expand command in Windows 7 computer with AMD Carrizo DDR4 processor and cannot find the file. Do you have any other suggestions? Thanks!
1 year ago
Paul P Chou
Need help in these steps:
- Create a c:\temp\976571 folder.
- Use the following command to extract the contents of the MSU file:
Expand –F:* c:\kb976571\Windows6.1-KB976571-v2-x64.msu c:\temp\976571
This resulted in extracting multiple files, which included the Windows6.1-KB976571-v2-x64.cab file.
I have cab files.
1) Do I press Windows + R and then in the folder, add a folder with the CAB name?
2) Expand –F:* c:\kb976571\Windows6.1-KB976571-v2-x64.msu c:\temp\976571 entered in CMD?
example: file name is Intel.cab. Does that mean it should be? –F:* c:\Intel\Intel c:\temp\IntelFor this: DISM.exe /Online /Add-Package /PackagePath
\temp\976571\Windows6.1-KB976571-v2-x64.cab
I should enter: DISM.exe /Online /Add-Package /PackagePath\temp\Intel\Intel.cab
1 year ago
Gekus
Thank you! This helps with KB4340558 update
Comments are closed.
还没有评论,来说两句吧...