次の方法で共有


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

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

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

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

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

Option Argument Description

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

/Get-Drivers

/All

/Format:Table

/Format: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 find out what drivers are in the image, as well as the state of the drivers (installed or staged).

Example:

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

/Get-DriverInfo

/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

/Add-Driver

/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 test 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 Understanding Device Drivers and Deployment.

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

/Remove-Driver

/Driver:<path_to_installed_driver1.inf>

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

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

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