An image backup is a copy of a computer’s hard drive. This file can be managed and modified with Windows’ built-in Deployment Image Servicing and Management (DISM) command-line tool. DISM supports offline and online servicing, allowing more flexibility for data management and recovery.
You can even have DISM configure a driver offline if you need to make changes to the Windows image. In this post, we’ll show you how to use DISM to configure device drivers without connecting to the Internet.
Adding Hardware Device Drivers to an Offline Image
Before you start, make sure you have admin access and your driver files are ready. To avoid duplication, you can also check the list of current drivers on the image using:
dism /image:C:\mount /get-drivers.
Once ready, follow these steps:
First, to add a specific driver, you can use the following command: dism /image:C:\test\offline /add-driver /driver:C:\drivers\mydriver.inf and follow the prompt.
On the other hand, you’ll need to create a folder if you wish to add multiple drivers. Then, type this command: dism /image:C:\mount /add-driver /driver:C:\drivers /recurse and confirm.
In this command line:
- /image:C:\mount indicates where the image is mounted.
- /driver:C:\drivers points to where the drivers are located.
If you’re installing device drivers in bulk, add the /recurse option. This will ensure that DISM automatically searches for drivers to install from the specified location.
Once you’ve added the necessary drivers, check if they’re integrated using the /get-drivers command again. Also, note that the driver servicing command only supports .inf files. Adding other driver package types like .exe files can cause an error.
As a reminder, Microsoft advises that driver packages can only be added offline on a computer running Windows 10 or later, Windows Server 2016 or later, or Windows PE for Windows 10 or later.
Removing Hardware Device Drivers from an Offline Image
Here’s how to remove old drivers from a Windows image with DISM: dism /image:C:\mount /remove-driver /driver:oem1.inf.
Replace /driver:oem1 .inf with the name of the driver you want to remove.
You can run /get-drivers to ensure that the correct device driver has been removed or that it has been properly uninstalled.
Understanding DISM and Driver Management
DISM is an administrator-level tool for fixing or modifying system images. It was initially introduced in Windows Vista to succeed other deployment tools like Package Manager, PEimg, ImageX, and Intlcfg. DISM continues to service newer editions of Windows OS.
One of DISM’s key features is offline servicing, which means you can modify a Windows image entirely offline before booting the operating system. Here are some of the actions and modifications you can do:
- Repair Windows image
- Add drivers to Windows image
- Remove drivers from Windows image
- Remove unnecessary files
- Change system settings
- Add or remove applications
- Install or uninstall Windows features or updates
As we focus on drivers, it’s good to highlight that adding or removing drivers is essential before deploying an image. These changes help ensure that the installed drivers are compatible with your device’s existing hardware, which limits the need for post-deployment troubleshooting.
Tip: Manually adding drivers into the boot.wim file may be able to fix an issue where the system isn’t correctly detecting devices and their corresponding drivers installed on the computer.
Best Practices and Troubleshooting
To avoid compatibility issues and system errors, consider these best practices and common troubleshooting tips:
Verifying driver integrity before adding them
One crucial thing you can do before storing your drivers is to verify their integrity. Here are some ways to check for any issues if you want to have DISM configure a driver offline:
- Verify device driver signatures
Driver signatures can be verified using the command-line Sigcheck utility.
- Check if device drivers are up-to-date
Device Manager can be used to manually check the status or update device drivers. Updating the drivers can fix bugs, enhance security, and address compatibility issues.
- Scan drivers for vulnerabilities
Driver Verifier can find potential defects, bugs, and violations in the drivers’ codes.
Since device drivers are granted some access to the operating system’s core, it’s crucial to verify the integrity and compatibility of the new software to avoid security and performance issues.
Ensuring compatibility with Windows versions
Considering your image file, ensure that the device drivers you plan to add are compatible with the version of Windows in your image. You can use the Device Manager to install updates or uninstall them to get an older driver version instead.
Common DISM errors and how to resolve them
You may also encounter some errors while using DISM. Here are the common ones and the corresponding troubleshooting steps:
- The source files could not be found
You can manually identify the source file using the /source command line: dism /image:C:\mount /cleanup-image /restorehealth /source:wim:D:\sources\install.wim:1 /limitaccess. Just replace the D:\sources\install.wim with the path to your Windows installation media (e.g., a mounted ISO or USB drive).
- Unspecified error
For this error code or prompt, Use Windows Command Prompt or Powershell with admin privileges. Run the System File Checker (SFC) to fix corrupted system files: sfc /scannow. If you still cannot address or isolate the issue, check the DISM log file (C:\Windows\Logs\DISM\dism.log) for additional information.
- The system cannot find the file specified
To fix this issue, you can start by double-checking the syntax and content of the DISM command (e.g., image path, driver path). Then, verify if the path or the file itself is accessible.
- Access denied
Ensure you have the necessary permissions to access the files or folders involved. Check if the file is set as read-only. Also, don’t forget that you should run DISM with administrator privileges.
Understanding these common DISM errors will make troubleshooting more efficient and effective.
- Using logs to diagnose issues (dism.log)
The DISM log file can be viewed by entering C:\Windows\Logs\DISM\dism.log using the Run dialog box.
Alternatively, you can use File Explorer’s address bar to quickly access the DISM log file. Just type C:\Windows\Logs\Dism in the search bar and press Enter.
Use Cases and Real-world Applications
These are some scenarios where using DISM to add or remove device drivers offline can be very useful:
- Pre-deployment prep: IT admins may use DISM to add the latest secure drivers before deploying an image
- Automation: To write scripts for automating driver updates more efficiently and potentially error-free.
- Security compliance: Remove unnecessary or outdated drivers to reduce vulnerabilities and compatibility issues.
Outdated, incompatible, or generic drivers can impact your system’s overall health and invite significant security risks. Hence, we encourage you to update drivers promptly, especially before a massive deployment event to your network.
Final Thoughts on Using DISM to Configure a Driver Offline
Servicing your Windows image offline using DISM can prevent various errors and hardware compatibility issues. Likewise, adding or removing device drivers as needed will ensure your image is always ready for eventual deployment, troubleshooting, or preparation for any crucial update.
For more tips on managing Windows image files, check out our complete guide on how to use the DISM command to fix and organize system files on your computer.