다음을 통해 공유


DISM Driver Servicing Command-Line Options

Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2

The driver servicing commands can be used on an offline image to add and remove drivers based on the INF file, and on a running operating system (online) to enumerate drivers. Microsoft® Windows® Installer or other driver package types (such as .exe files) are not supported.

You can specify a directory where the driver INF files are located, or you can point to a driver by specifying the name of the INF file.

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 driver servicing options are available for an offline image.

DISM.exe /image:<path_to_image_directory> [/Get-Drivers | /Get-DriverInfo | /Add-Driver | /Remove-Driver | /Export-Driver]

The following driver servicing options are available for a running operating system.

DISM.exe /Online [/Get-Drivers | /Get-DriverInfo | /Export-Driver]

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

Option/Argument Description

Option: /Get-Help /?

When used immediately after a driver 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 /image:C:\test\offline /Add-Driver /?

Dism /online /Get-Drivers /?

Option: /Get-Drivers

Arguments:

/All

/Format:{Table | List}

Displays basic information about driver packages in the online or offline image.

By default, only third-party drivers will be listed. Use the /all argument to display information about default drivers and third-party drivers. Use the /Format:Table or /Format:List argument to display the output as a table or a list.

If you point to an image, you can determine what drivers are in the image, in addition to the state of the drivers (installed or staged).

Example:

Dism /image:C:\test\offline /Get-Drivers

Dism /online /Get-Drivers

Option: /Get-DriverInfo

Arguments:

/Driver:<installed_INF_FileName>

/Driver:<path_to_driver.inf>

Displays detailed information about a specific driver package.

You can point to an INF file installed in the image, or one that is not yet installed. You can specify the name of the uninstalled driver or the third-party driver in the device driver store. Installed third-party drivers in the driver store will be named Oem0.inf, Oem1.inf, and so on. This is referred to as the published name.

You can specify multiple drivers on the command line by using the /driver option multiple times.

Example:

First, use the /Get-Drivers option so that you can identify a driver INF file. Then run the following command:

Dism /image:C:\test\offline /Get-DriverInfo /driver:<path_to_driver.inf>

Dism /online /Get-DriverInfo /driver:C:\test\drivers\usb\usb.inf

Option: /Add-Driver

Arguments:

/Driver:<folder_containing_INF>

/Driver:<path_to_driver.inf>

/Recurse

/ForceUnsigned

Adds third-party driver packages to an offline Windows image.

When you use the /Driver option to point to a folder, INF files that are not valid driver packages are ignored. These files are reported on the console when the command runs, and a warning is included in the log file. You will not receive an error message.

If you point to a path and use the /Recurse option, all subfolders are queried for drivers to add.

For testing purposes you can use /ForceUnsigned to add unsigned drivers and override the requirement that drivers installed on X64-based computers must have a digital signature. For more information about driver signing requirements, see Device Drivers and Deployment Overview.

Examples:

Dism /image:C:\test\offline /Add-Driver /driver:C:\test\drivers\

Dism /image:C:\test\offline /Add-Driver /driver:C:\test\drivers /recurse

Dism /image:C:\test\offline /Add-Driver /driver:C:\test\drivers\mydriver.inf

Dism /image:C:\test\offline /Add-Driver /driver:C:\test\drivers\mydriver.inf /ForceUnsigned

Option: /Remove-Driver

Arguments:

/Driver:<published_name>

Removes third-party drivers from an offline image.

When third-party drivers are added, they are named Oem0.inf, Oem1.inf, and so on. You must specify the <published name> (for example, Oem1.inf) to remove the driver. You cannot remove default drivers.

Warning
Removing a boot-critical driver package can make the offline Windows image unbootable.

You can specify multiple drivers on the command line by using the /Driver option multiple times.

Examples:

Dism /image:C:\test\offline /Remove-Driver /driver:oem1.inf

Dism /image: C:\test\offline /Remove-Driver /driver:oem1.inf /driver:oem2.inf

Option: /Export-Driver

Arguments:

/Destination:<path_to_destination_folder>

Exports all third-party driver packages from a Windows image to a destination path. The exported drivers can then be injected to an offline image by running the DISM Add-Driver command. This command is new for Windows 8.1 Update.

Examples:

DISM /Online /Export-Driver /Destination:C:\destpath

DISM /Image:C\test\offline /Export-Driver /Destination:C:\destpath

Limitations

  • The driver servicing command supports only .inf files. Windows Installer or other driver package types (such as .exe files) are not supported.

  • Drivers are installed in the order that they are listed in the command line. In the following example, 1.inf, 2.inf, and 3.inf will be installed in the order that they are listed in the command line.

    Dism /Image:C:\test\offline /Add-Driver /Driver:C:\test\drivers\1.inf /Driver:C:\test\drivers\2.inf /Driver:C:\test\drivers\3.inf
    

See Also

Reference

DISM Image Management Command-Line Options

Concepts

DISM Overview (Deployment Image Servicing and Management)

Other Resources

Deployment Image Servicing and Management (DISM) Command-Line Options