Operating System Package Servicing Command-Line Options
3/21/2011
Operating system package-servicing commands can be used offline to install, remove, or update Windows packages provided as cabinet (.cab) or Windows Update Stand-alone Installer (.msu) files. Packages are used by Microsoft to distribute software updates, service packs, and language packs. Packages can also contain Windows features. You can also use these servicing commands to enable or disable Windows features, either offline or on a running Windows installation. Features are optional components for the core operating system.
The following is the base syntax for servicing a Windows image using DISM:
DISM {/Image:<path_to_image_directory> | /Online} [dism_options] {servicing_command} [servicing_argument]
The following operating system package-servicing options are available for use with an offline image:
DISM /Image:<path_to_image_directory> [/Get-Packages | /Get-PackageInfo | /Add-Package | /Remove-Package] [/Get-Features | /Get-FeatureInfo | /Enable-Feature | /Disable-Feature]
The following operating system package-servicing options are available for use with a running operating system:
DISM /Online [/Get-Packages | /Get-PackageInfo | /Add-Package | /Remove-Package | /Get-Features | /Get-FeatureInfo | /Enable-Feature | /Disable-Feature]
The following table provides a description of how each operating system package-servicing option can be used. These options are not case sensitive. However, feature names are case sensitive.
Option | Argument | Description |
---|---|---|
/Get-Help /? |
|
When used immediately after a package servicing command-line option, information about the option and the arguments is displayed. Additional topics might become available when an image is specified. |
/Get-Packages |
/Format:Table /Format:List |
Displays basic information about all packages in the image. Use the /Format:Table or /Format:List argument to display the output as a table or a list. |
/Get-PackageInfo |
/PackageName: <name_in_image> /PackagePath: <path_to_cabfile> |
Displays detailed information about a package provided as a .cab file. Only .cab files can be specified. You cannot use this command to get package information for .msu files. /PackagePath can point to either a .cab file or a folder. You can use the /Get-Packages option to find the name of the package in the image, or you can specify the path to the .cab file. The path to the .cab file should point to the original source of the package, not to where the file is installed on the offline image. |
/Add-Package |
/PackagePath:<path_to_cabfile> /IgnoreCheck |
Installs a specified .cab or .msu package in the image. Multiple packages can be added on one command line. The applicability of each package will be checked. If the package is not applicable to the specified image, you will receive an error message. Use the /IgnoreCheck argument if you want the command to process without checking the applicability of each package. /PackagePath can point to the following:
|
/Remove-Package |
/PackageName: <name_in_image> /PackagePath: <path_to_cabfile> |
Removes a specified .cab file package from the image. Only .cab files can be specified. You cannot use this command to remove .msu files.
Note:
Using this command to remove a package from a Windows Preinstallation Environment (Windows PE) 3.0 image will not recover any space in the image.
You can use the /PackagePath option to point to the original source of the package, specify the path to the .cab file, or you can specify the package by name as it is listed in the image. Use the /Get-Packages option to find the name of the package in the image.
Note:
/Remove-Package is not supported in Standard 7 and using it may cause instability in your image or even cause your image to become non-bootable.
|
/Get-Features |
/PackageName: <name_in_image> /PackagePath: <path_to_cabfile> /Format:Table /Format:List |
Displays basic information about all features (operating system components that include optional Windows foundation features) in a package. You can use the /Get-Features option to find the name of the package in the image, or you can specify the path to the original source of the package. If you do not specify a package name or path, all features in the image will be listed. /PackagePath can point to either a .cab file or a folder. Feature names are case sensitive. Use the /Format:Table or /Format:List argument to display the output as a table or a list. |
/Get-FeatureInfo |
/FeatureName: <name_in_image> /PackageName: <name_in_image> /PackagePath: <path_to_cabfile> |
Displays detailed information about a feature. You must use /FeatureName. You can use the /Get-Features option to find the name of the feature in the image. Feature names are case sensitive. /PackageName and /PackagePath are optional and can be used to find a specific feature in a package. |
/Enable-Feature |
/FeatureName: <name_in_image> /PackageName: <name_in_image> /PackagePath: <path_to_package> |
Enables or updates the specified feature in the image. You must use the /FeatureName option. Use the /Get-Features option to find the name of the feature in the image. Feature names are case sensitive. You do not need to specify the /PackageName if it is a Windows Foundation Package. Use /PackagePath to point to the original source of the package. If the package is not already installed, it will be installed and enabled. |
/Disable-Feature |
/FeatureName: <name_in_image> /PackageName: <name_in_image> |
Disables the specified feature in the image. You must use the /FeatureName option. Use the /Get-Features option to find the name of the feature in the image. Feature names are case sensitive. |
/Cleanup-Image |
/RevertPendingActions |
Performs cleanup or recovery operations on the image. If you experience a boot failure, you can use the /RevertPendingActions option to attempt a system recovery. The operation reverts all pending actions from the previous servicing operations because these actions might be the cause of the boot failure. The /RevertPendingAction option is not supported on a running operating system or a Windows PE or a Windows Recovery Environment (Windows RE) image.
Important:
You should use the /RevertPendingActions option only in a system-recovery scenario to perform recovery operations on a Windows image that failed to boot.
|
Limitations
- When you are installing a package in an offline image, the package state is "install pending" because of not-yet-completed online actions. In other words, the package will be installed when the image is booted and the online actions are processed. If subsequent actions are requested, they cannot be processed until the previous pending online action is completed.
- If a package is in the "install pending" state and then you stage the package, the package state is set to "uninstall pending". This is because the package must be uninstalled before it can be staged.
- Some packages require additional packages to be installed first. You should not assume that dependencies will be satisfied when the image is booted and the online actions are processed. If there are dependency requirements, you should use an answer file to install the necessary packages. By passing an answer file to DISM, multiple packages can be installed in the correct order. This is the preferred method for installing multiple packages.
- Packages are installed in the order that they are listed in the command line.
- When using DISM to list the feature packages in a Windows PE image, the packages will always be listed as pending even when the servicing operation was successful. This is by design and requires no further action.
See Also
Concepts
What Is Deployment Image Servicing and Management?
How Deployment Image Servicing and Management Works
Deployment Image Servicing and Management Command-Line Options
Windows PE Servicing Command-Line Options
Driver Servicing Command-Line Options
International Servicing Command-Line Options