Dela via


DISM Unattended Servicing Command-Line Options

If you are installing multiple packages to a Windows image, use DISM to apply an unattend.xml answer file to the image. Some packages require other packages to be installed first. If there is a dependency requirement, the best way to ensure the correct order of the installation is by using an answer file. When you use DISM to apply an unattend.xml answer file to an image, the unattended settings in the offlineServicing configuration pass are applied to the Windows image.

The base syntax for servicing a Windows image using DISM is:

DISM.exe {/Image:<path_to_ image_directory> | /Online} [dism_global_options] {servicing_option} [<servicing_argument>]

The following servicing options are available to apply an unattend.xml answer file to an offline Windows image:

DISM.exe /Image:<path_to_ image_directory> /Apply-Unattend:<path_to_unattend.xml>

The following servicing options are available to apply an unattend.xml answer file to a running operating system:

DISM.exe /Online /Apply-Unattend:<path_to_unattend.xml>

The following table provides a description of how an unattended servicing option can be used. These options are not case sensitive.

/Get-Help /?

When used immediately after an unattended servicing command-line option, information about the option and the arguments is displayed. Additional topics might become available when an image is specified.

Examples:

Dism /online /Apply-Unattend /?
Dism /image:C:\test\offline /Apply-Unattend /?

/Apply-Unattend

Applies an Unattend.xml file to an image.

Syntax:

Apply-Unattend:<path_to_unattend_file>

If you're updating device drivers using an unattended answer file, you must apply the answer file to an offline image and specify the settings in the offlineServicing configuration pass.

If you are updating packages or other settings using an unattended answer file, you can apply the answer file to an offline or online image. Specify the settings in the offlineServicing configuration pass.

Examples:

Dism /image:C:\test\offline /Apply-Unattend:C:\test\answerfiles\myunattend.xml
Dism /online /Apply-Unattend:C:\test\answerfiles\myunattend.xml

Limitations

  • You can't use other servicing commands on the same command line with unattended servicing commands.

  • Only a single unattend.xml answer file can be specified on any command line.

  • When you add packages to an image using an unattended answer file, the applicability of the package will not be checked. The answer file will be applied, and the operation will complete even if there are packages specified in the answer file which do not apply to the image. If you have to check the applicability of a package when you add it to an image, use the DISM /Add-Package option without the /ignorecheck option. For more information, see DISM Operating System Package Servicing Command-Line Options.

  • If you are updating device drivers using an unattended answer file, you must apply the answer file to an offline image.

  • When you use DISM.exe to apply an answer file to a running operating system, the answer file should only contain elements in the offlineServicing configuration pass. This is because some settings in the Specialize configuration pass might be applied to the operating system. We recommend that the answer file that you use with DISM only contain settings in the offlineServicing configuration pass.

  • The recommended way to author answer files is to create them in Windows System Image Manager (Windows SIM). However, if you use a manually authored answer file, you must validate the answer file in Windows SIM to verify that it works. For more information, see Best Practices for Authoring Answer Files.

  • When you apply an answer file by using DISM, the answer file is not cached on the target computer.

What is DISM?

DISM Image Management Command-Line Options

DISM Languages and International Servicing Command-Line Options

DISM Operating System Package Servicing Command-Line Options

DISM Windows Edition-Servicing Command-Line Options

DISM Driver Servicing Command-Line Options