Operating System Package Servicing Command-Line Options (Standard 8)

7/8/2014

Review the operating system package servicing command-line options for Deployment Image Servicing and Management (DISM) in Windows Embedded 8 Standard (Standard 8).

Operating system package-servicing commands can be used offline to install, remove, or update CBS packages provided as cabinet (.cab) or Windows Update Stand-alone Installer (.msu) files. CBS packages are used by Microsoft to distribute software updates, service packs, and language packs. CBS 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 | /Cleanup-Image]

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 | /Cleanup-Image]

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

/?

 

Displays information about available DISM command-line options and arguments. When used immediately after a command-line option, information about the option and its arguments is displayed.

Additional topics might become available when an image is specified.

/Get-Packages

[/Format:{Table | List}]

Displays basic information about all CBS 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 CBS package provided as a .cab file. Only .cab files can be specified. You cannot use this command to get CBS 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 CBS package in the image, or you can specify the path of the .cab file. The path of the .cab file should point to the original source of the CBS package, not to where the file is installed on the offline image.

/Add-Package

/PackagePath:<path_to_cabfile>

[/IgnoreCheck]

[/PreventPending]

Installs a specified .cab or .msu package in the image. Multiple CBS packages can be added on one command line. The applicability of each CBS package will be checked. If the CBS package does not apply 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 CBS package.

Use the /PreventPending option to skip the installation of the CBS package if the CBS package or Windows image has pending online actions.

/PackagePath can point to the following:

  • A single .cab or .msu file
  • A folder that contains a single expanded .cab file
  • A folder that contains a single .msu file
  • A folder that contains multiple .cab or .msu files

/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.

JJ980287.note(en-us,WinEmbedded.81).gifNote:
Using this command to remove a CBS package from a Windows Preinstallation Environment (Windows PE) 4.0 image will not recover any space in the image.

You can use the /PackagePath option to point to the original source of the CBS package, specify the path of the .cab file, or you can specify the CBS package by name as it is listed in the image. Use the /Get-Packages option to find the name of the CBS package in the image.

JJ980287.note(en-us,WinEmbedded.81).gifNote:
/Remove-Package is not supported in Standard 8 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 | List}]

Displays basic information about all features (operating system components that include optional Windows foundation features) in a CBS package. You can use the /Get-Features option to find the name of the CBS package in the image, or you can specify the path of the original source of the CBS package. If you do not specify a CBS 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 CBS package.

/Enable-Feature

/FeatureName:<name_in_image>

[/PackageName:<name_in_image>]

[/Source:<source>]

[/LimitAccess]

[/All]

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 have to specify the /PackageName if it is a Windows Foundation Package.

You can restore and enable a feature that has previously been removed from the image. Use the /Source argument to specify the location of the files that are required to restore the feature.

If you specify multiple /Source arguments, the files are gathered from the first location where they are found and the rest of the locations are ignored. If you do not specify a /Source for a feature that has been removed, the default location in the registry is used or, for online images, Windows Update (WU) is used.

Use /LimitAccess to prevent DISM from contacting WU for online images.

Use /All to enable all parent features of the specified feature.

/Disable-Feature

/FeatureName:<name_in_image>

/PackageName:<name_in_image>

[/Remove]

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.

You can specify /FeatureName multiple times in one command line for features in the same parent CBS package.

Feature names are case sensitive.

You do not have to specify the CBS package name using the /PackageName option if it is a Windows Foundation Package. Otherwise, use /PackageName to specify the parent package of the feature.

Use /Remove to remove a feature without removing the feature's manifest from the image. The feature will be listed as "Removed" when you use /Get-FeatureInfo to display feature details and can be restored and enabled using /Enable-Feature with the /Source option.

/Cleanup-Image

{/RevertPendingActions | /SPSuperseded [/HideSP] | /StartComponentCleanup | /CheckHealth | /ScanHealth | /RestoreHealth}

[/Source:<source>]

[/LimitAccess]

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 4.0 or a Windows Recovery Environment (Windows RE) image.

JJ980287.note(en-us,WinEmbedded.81).gifImportant:
You should use the /RevertPendingActions option only in a system-recovery scenario to perform recovery operations on a Windows image that did not boot.

Use /SPSuperseded to remove any backup files created during the installation of a service pack. Use /HideSP to prevent the service pack from being listed in the Installed Updates Control Panel.

JJ980287.note(en-us,WinEmbedded.81).gifImportant:
The service pack cannot be uninstalled after the /SPSuperseded operation is completed.

Use /StartComponentCleanup to clean up the superseded components and reduce the size of the component store.

Use /CheckHealth to check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired.

Use /ScanHealth to scan the image for component store corruption. This operation will take several minutes.

Use /RestoreHealth to scan the image for component store corruption, and then perform repair operations automatically. This operation will take several minutes.

Use /Source with /RestoreHealth to specify the location of known good versions of files that can be used for the repair, such as a path to the Windows directory of a mounted image.

If you specify multiple /Source arguments, the files are gathered from the first location where they are found and the rest of the locations are ignored. If you do not specify a /Source for a feature that has been removed, the default location in the registry is used or, for online images, Windows Update (WU) is used.

Use /LimitAccess to prevent DISM from contacting WU for online images.

Limitations

  • When you install a CBS package in an offline image, the CBS package is in an installation pending state because there are online actions that are not yet completed. In other words, the CBS package is 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 CBS package is in the installation pending state and then you stage the CBS package, the CBS package state is set to uninstallation pending. This is because the CBS package must be uninstalled before it can be staged.
  • Some CBS packages require additional CBS 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 a configuration file to install the necessary packages. By passing a configuration file to DISM, multiple CBS packages can be installed in the correct order. This is the preferred method for installing multiple CBS packages.
  • CBS packages are installed in the order that they are listed in the command line.
  • When using DISM to list the CBS packages in a Windows PE 4.0 image, the CBS packages are always listed as pending even when the servicing operation was successful. This is by design and requires no additional action.

See Also

Concepts

Deployment Image Servicing and Management (DISM) Command-Line Options
What Is Deployment Image Servicing and Management?
How Deployment Image Servicing and Management (DISM) Works
Operating System Module Servicing Command-Line Options
Windows PE Servicing Command-Line Options
Driver Servicing Command-Line Options
International Servicing Command-Line Options