Using the DISM tool to add packages

Deployment Image Servicing and Management (DISM) is a command-line tool that enables system administrators to prepare and service Windows images. DISM can be accessed either through Command Prompt or from Windows PowerShell. It can capture, deploy, service, and manage Windows images used for Windows Preinstallation Environment (WinPE), Windows Recovery Environment (WinRE), and Windows Setup. Most commonly, DISM is used to apply updates, drivers, and language packs to a Windows image both offline and online. In Windows 10, DISM is located at C:\Windows\System32\DISM. Unlike DISM, Windows System Image Manager (Windows SIM) is a graphical tool that system administrators can use to create unattended installation answer files. An answer file has an .xml extension and can be used for Windows installation without the presence of help desk technician.

In addition, an answer file enables you to automate the Out-of-Box Experience (OOBE), which represents the first experience that a user has when using the Windows OS for the first time. It consists of initial configurations steps, such as picking a region, selecting a keyboard and adding a second keyboard, accepting the Windows license agreement, getting connected to wired or wireless networks, setting up a Microsoft account, setting up privacy, and setting up Cortana.

To add a driver package to the Windows image using the DISM command-line tool, complete the following steps:

  1. Press Windows key + X to open the administrator's menu.
  2. Select Windows PowerShell (Admin).
  3. Locate the folder where your Windows 10 image is located (install.wim) and write down the path.
  4. Create a folder in any of your disk partitions and name it accordingly (mine is DISM_Test).
  5. In Windows PowerShell, enter the DISM /Get-Imageinfo /ImageFile:D:\Windows10\sources\install.wim command to gather information about all of the images in a WIM file.
  6. Then, enter the DISM /Mount-Image /ImageFile:D:\Windows10\sources\install.wim /Name:"Windows 10 Pro"  /MountDir:D:\DISM_Test command to mount a Windows image.
  7. And to add the driver package to the Windows image, enter the DISM /Image:D:\DISM_Test /Add-Driver /Driver:D:\sp72517\RTWLANE_Driver\Win10X64\netrtwlane.inf command, as shown in Figure 3.11:
Figure 3.11. Adding a driver package to the Windows image using DISM