Partager via


Unattended Servicing Command-Line Options

Applies To: Windows 7

Note

This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.

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_options] {servicing_command} [<servicing_argument>]

The following servicing options are available to apply an unattend.xml answer file to a 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.

Option Description

/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:<path_to_unattend.xml>

Applies an unattend.xml file to an image.

If you are 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.

Example:

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

Limitations

  • You cannot 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 are not applicable to the image. If you need to check the applicability of a package while you add it to an image, use the DISM command with the /Add-Package option without the /ignorecheck option. For more information, see 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 get applied to the operating system. We recommend that the answer file 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 using DISM, the answer file is not cached on the target computer.

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
Languages and International Servicing Command-Line Options
Driver Servicing Command-Line Options
Operating System Package Servicing Command-Line Options
Windows Edition-Servicing Command-Line Options