[fw]How to use DISM to install a hotfix from within Windows

How to use DISM to install a hotfix from within
Windows

Jeff
Hughes (CORE)

15 Feb 2011 10:10 AM

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:c:\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:

1. Create a
c:\temp\976571 folder.

2. 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:c:\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:c:\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:c:\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

[fw]How to use DISM to install a hotfix from within
Windows

时间: 2024-07-30 00:31:49

[fw]How to use DISM to install a hotfix from within Windows的相关文章

转-How to install an SSH Server in Windows Server 2008

window也可以通过ssh客户端连接,具体方式参考下面 1 How to install an SSH Server in Windows Server 2008 2 freeSSHd and freeFTPd 下载 3 SSH server rejected X11 forwarding request

How to install DIG dns tool on windows 7

This guide explain how to install dig dns tool on windows 7 in few steps: 1. First go to http://www.isc.org/downloads and look for BIND, underneath select right version, for windows we have to choose the "(zip)" option of the latest release of B

Install Exchange 2016 CU3 on Windows server 2016

1.Download Ex2016 cu3: Exchange 2016 CU3: Notable fixes and improvements are: Added: Support for Windows Server 2016. KB3154387: The DFS health set is listed as "Unhealthy" in an Exchange Server 2016 environment. KB316916: Data loss may occur du

How to install BMW E-sys software on Windows XP & Mac OS X

It’s an instruction on how to setup BMW ENET cable software E-SYS on Windows XP & Mac OS X. Requirement: Laptop running Windows XP or higher (Mac OS X is capable, only if running a windows VM) 2GB RAM 3GB Free Hard Drive Space WiFi Connection at the

Install Exchange Server 2013 on Windows Server 2008

OS 要求 Exchange Server 2013可以部署在Windows Server 2012的平台也可以部署在Windows Server 2008 R2的平台.如果部署在Windows Server 2008 R2平台要求操作系统版本为Windows Server 2008 R2 SP1的版本? 安装服务器角色 : PowerShell中执行如下命令 , 打开Windows PowerShell 运行如下命令来加载服务器管理器模块 ? Import-Module ServerMana

Install Exchange Server 2013 on Windows Server 2012

?前面几篇介绍了Exchange Server 2013预览版在Windows 2008 R2环境下单机部署.下面,将在Windows Server 2012 RC的基础下进行分角色部署.Exchange Server 2013把角色缩减为了客户端访问角色和邮箱角色,其中UM角色和集线器传输都整合到了客户端访问当中.接下来介绍下本次部署的环境,本次部署采用5台Windows Server 2012RC服务器进行部署,分别部署两台CAS角色和两台Mailbox角色,一台DC,并实现DAG和CASA

Batch install the hotfix use command

FW: Can’t Create File In The C Drive Root Directory – Windows 8

http://www.mkyong.com/computer-tips/cant-create-file-in-the-c-drive-root-directory-windows-8/ Developing a simple Java program to write a file in the C drive root directory (where Windows is installed), but the program prompts an “access is denied” e

Install OpenCV in Windows for Python

Here I will tell you how to install OpenCV 2.4x in Windows  for Python 2.7. Pre-requisites ( need to be downloaded ) : Python : Download latest version of Python 2.7 from Python site.Numpy : Download Numpy for Python 2.7 from here.OpenCV 2.4 : Downlo