Windows 10: DISM - Add or Remove Drivers on an Offline Image

Discus and support DISM - Add or Remove Drivers on an Offline Image in Windows 10 Tutorials to solve the problem; How to: DISM - Add or Remove Drivers on an Offline Image [img] Information Servicing an offline image, mounting an image, committing changes, it... Discussion in 'Windows 10 Tutorials' started by Jerry06, Oct 11, 2017.

  1. Jerry06 Win User

    DISM - Add or Remove Drivers on an Offline Image


    How to: DISM - Add or Remove Drivers on an Offline Image

    DISM - Add or Remove Drivers on an Offline Image [​IMG]
    Information Servicing an offline image, mounting an image, committing changes, it all sounds a bit complicated to an average Windows user. However, it's just geek speak meaning modifying default Windows install image, the install.wim file. It is a straight forward procedure. When changes have been committed (written, saved) to image, the modified install.wim can be used to deploy Windows or to replace original install.wim on existing install media.

    Servicing an offline image is done with DISM (Deployment Image Servicing and Management), a native Windows tool. DISM command options allow all kind of changes, changing the way Windows will be installed. Drivers can be added or removed, language packs applied to create a multilingual Windows install media, Windows Updates applied to get a new Windows installation to be up to date straight after installation, and so on.

    A default Windows install media is hardware independent, meaning that it can be used to install Windows on any hardware capable of running Windows. Windows will be installed with default drivers, then after the installation Windows Update searches for correct drivers installing them or the user installs drivers manually using ones provided by manufacturer.

    If the install media will be used on specific hardware, you can shorten the time required to install Windows, as well as time required for post install update by adding hardware specific drivers to install media.

    This tutorial will show how to use DISM to add or remove drivers on an offline image of Windows.




    Contents [/i] Use links below to go to any step, back button of your browser to return to this list.


    [table][tr][td]Step One:[/td] [td]Get drivers: Download[/td] [/tr] [tr][td]Step Two:[/td] [td]Get drivers: Export[/td] [/tr] [tr][td]Step Three:[/td] [td]Mount offline image [/td] [/tr] [tr][td]Step Four:[/td] [td]Add drivers to image [/td] [/tr] [tr][td]Step Five:[/td] [td]Unmount offline image [/td] [/tr] [tr][td]Step Six:[/td] [td]Create updated ISO[/td] [/tr] [/table]


    DISM - Add or Remove Drivers on an Offline Image [​IMG]
    Note Steps One & Two will show both available methods to get drivers to be added to image. Usually you would need to use one of the methods to get correct drivers, download drivers from manufacturer's site or export drivers from an existing Windows 10 installation on exactly the same hardware. However, there's nothing to prevent using both methods; you could for instance export drivers from an existing Windows installation on similar but not exactly the same hardware setup, then remove drivers that are different on hardware where your install media will be used and download those drivers from manufacturer's site.

    Exporting drivers from an existing installation on same hardware is my preferred method. Exporting the full set of drivers and adding them to offline image is very practical especially for private users who want to make an install media for their own hardware. A reinstall using such media is as easy as it can be, providing a complete Out-of-Box Windows installation without any need to start installing hardware drivers after the installation.



    Step One [/i] Get drivers: Download 1.1) Download required drivers from manufacturer's site

    1.2) Most often the drivers come as a self-extracting executable (.exe) or archived (.zip) file. You must extract drivers first, an archive file can't be used. To be able to add an individual driver, you will need its .inf file




    Step Two [/i] Get drivers: Export 2.1) Create a new folder for exported drivers, in this example I'll make it as D:\Drivers

    2.2) To export all hardware drivers from an existing Windows 10 installation, use following command in elevated PowerShell (tutorial), replacing path D:\Drivers with your actual path:

    dism /Online /Export-Driver /DestinationDISM - Add or Remove Drivers on an Offline Image :D:\Drivers

    Drivers will be exported to your chosen folder:

    DISM - Add or Remove Drivers on an Offline Image [​IMG]



    DISM - Add or Remove Drivers on an Offline Image [​IMG]
    Note Exporting drivers with DISM does not give much information about what was exported. Folder names for individual drivers as shown in sample screenshot above in 2.2 are also not very informative.

    If you want to know what is exported, you can use PowerShell cmdlets instead. First, I will export drivers saving the exported driver information to a variable $Drivers (use any variable name you prefer) with following command:

    $Drivers = Export-WindowsDriver -Online -Destination D:\Drivers

    Now I can ask PowerShell to show me the contents of variable $Drivers, sorting it as I prefer:

    $Drivers | Select-Object ClassName, ProviderName, Date, Version | Sort-Object ClassName

    DISM - Add or Remove Drivers on an Offline Image [​IMG]


    Exported drivers are the same than when using DISM command instead, it's just that using PowerShell cmdlets I can get some valuable information about what was exported.




    Step Three [/i] Mount Offline Image 3.1) Create a new folder to temporarily store the contents of Windows 10 ISO image, name it as you want to. In this example I create the folder on drive D: naming it ISO_Files.

    3.2) Mount a Windows 10 ISO image as virtual DVD by double clicking it, alternatively right clicking it and selecting Mount. Open mounted ISO in Explorer, select all files and folders with CTRL + A and copy them with CTRL + C, paste the ISO content to ISO_Files folder with CTRL + V:


    DISM - Add or Remove Drivers on an Offline Image [​IMG]




    DISM - Add or Remove Drivers on an Offline Image [​IMG]



    DISM - Add or Remove Drivers on an Offline Image [​IMG]
    Note If you have Windows 10 install media on a USB flash drive, you can skip steps 3.1 & 3.2 and use it instead.
    3.3) Create a folder to mount offline image. In this example I use folder C:\Mount.

    3.4) Open elevated PowerShell (tutorial). Enter following command to check what editions are included in image:

    Dism /Get-WimInfo /WimFileDISM - Add or Remove Drivers on an Offline Image :D:\ISO_Files\Sources\install.wim

    Note the index number of your selected edition. In this example I have copied all content of Windows 10 Fall Creators Update version 1709 to ISO_Files folder. I want to use PRO edition to add drivers to it, noting its index number 8:


    DISM - Add or Remove Drivers on an Offline Image [​IMG]


    3.5) Mount the image of your preferred Windows 10 edition using it's index number, index 8 in this example:

    Dism /Mount-Image /ImageFileDISM - Add or Remove Drivers on an Offline Image :D:\ISO_Files\Sources\install.wim /Index:8 /MountDir:C:\Mount

    Notice please: you can also mount and service a virtual hard disk (VHD or VHDX file). When mounting a VHD file, index number is always 1. Set /ImageFile as path to virtual hard disk file, for instance mounting a VHDX file named W10PROx64.vhdx which is stored in folder F:\VHD_Files, you would use the following mount command:

    Dism /Mount-Image /ImageFile:F:\VHD_Files\W10PROx64.vhdx /Index:1 /MountDir:C:\Mount

    This will take some time. Please notice, the drive where the Mount folder is located needs some free space. I do not recommend mounting a WIM image to a folder on a drive with less than 15 GB free space. For instance, mounting the multi edition build 16299.15 image requires almost 12 GB, in addition to space required to work with the image:

    DISM - Add or Remove Drivers on an Offline Image [​IMG]

    Mounting a VHD / VHDX file requires at least as much free space on drive where Mount folder is located as is the size of the virtual hard disk. If you mount a dynamically expanding 64 GB virtual hard disk to be serviced, you need at least 70 GB free space.





    Step Four [/i] Add drivers to image

    DISM - Add or Remove Drivers on an Offline Image [​IMG]
    Note You can always check which drivers are already present in offline image with following command:

    Dism /Image:C:\Mount /Get-Drivers 4,1) If you downloaded individual drivers, you can add them now to offline mounted image with following command:

    dism /Image:C:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf

    Replace mount folder path C:\Mount in above sample command with actual path to your mount folder, and driver path and name X:\Drivers\DriverName.inf with actual path to downloaded driver

    4.2) If the driver is unsigned, use the following command:

    dism /Image:C:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf /ForceUnsigned

    4.3) If you want to remove a driver from offline image, use the following command:

    dism /Image:C:\Mount /Remove-Driver /Driver:X:\Drivers\DriverName.inf

    4.4) With /Add-Driver and /Remove-Driver you can add or remove multiple drivers:

    dism /Image:C:\Mount /Add-Driver /Driver:X:\Drivers\DriverName.inf /Driver:X:\Drivers\Driver2Name.inf

    4.5) If you have drivers on one folder and its subfolders, like for instance when exported from an existing installation, you can add all drivers with one simple command, replacing mount folder and drivers folder paths with your actual paths:

    dism /Image:C:\Mount /Add-Driver /DriverDISM - Add or Remove Drivers on an Offline Image :D:\Drivers /Recurse

    /Recurse switch will tell PowerShell to go through the main folder and its subfolders, adding all drivers it finds:

    DISM - Add or Remove Drivers on an Offline Image [​IMG]

    (Click to enlarge.)



    Step Five [/i] Unmount offline image 5.1) All done, you can save changes and unmount offline image with following command:

    dism /Unmount-Image /MountDir:C:\Mount /Commit

    DISM - Add or Remove Drivers on an Offline Image [​IMG]


    The /Commit switch is the important one, it commits (saves) all changes to the image.




    Step Six [/i] Create updated ISO 6.1) If you were using install.wim from a USB flash drive, you are ready. It now contains an updated Windows install image

    6.2) If you were using ISO_Files folder on HDD, it now contains all files needed to create an updated ISO image. See Part Five in following tutorial for instructions in creating the ISO: Create Windows 10 ISO image from Existing Installation Installation Upgrade Tutorials

    That's it! If you have any issues with this, do not hesitate to post in this thread.

    Kari


    Related Tutorials

    :)
     
    Jerry06, Oct 11, 2017
    #1

  2. DISM

    I managed to mount image with command Dism /Mount-Wim /WimFile:C:\images\install.wim /Index:1 /MountDir:C:\test\images. Now I have a problem with adding drivers. Tried 2 commands:

    Dism /Image:C:\test\images\offline /Add-Driver /Driver:C:\drivers\hp630x64.inf; and

    Dism /Add-Driver /Image:C:test\images /Driver:C:\drivers\hp630x64.inf.

    Both don't work.
     
    MiodragMilincic, Oct 11, 2017
    #2
  3. Windows 7 backup on Windows 10 system is restoroing to a restore point

    We seem to go from one problem to another! I have attempted to run the DISM commands from a command prompt administrator. I include here the command results., which shows that the DISM setup on my PC does not match what you expected, and does not work
    any way: -
    Microsoft Windows [Version 10.0.15063]

    (c) 2017 Microsoft Corporation. All rights reserved.
    C:\WINDOWS\system32>sfc /scannow
    Beginning system scan. This process will take some time.
    Beginning verification phase of system scan.

    Verification 100% complete.
    Windows Resource Protection did not find any integrity violations.
    C:\WINDOWS\system32>dism/online/optimize-image
    Deployment Image Servicing and Management tool

    Version: 10.0.15063.0

    Error: 87
    The online/optimize-image option is unknown.

    For more information, refer to the help by running DISM.exe /?.
    The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log
    C:\WINDOWS\system32>DISM.exe /Online /?
    Deployment Image Servicing and Management tool

    Version: 10.0.15063.0
    Image Version: 10.0.15063.0

    The following commands may be used to service the image:
    WINDOWS EDITION SERVICING COMMANDS:
    /Optimize-Image - Performs specified configurations to an offline

    image.

    /Set-ProductKey - Sets the product key of the offline image.

    /Get-TargetEditions - Displays a list of Windows editions that an image

    can be upgraded to.

    /Get-CurrentEdition - Displays the edition of the current image.

    /Set-Edition - Upgrades an image to a higher edition.
    DEFAULT ASSOCIATIONS COMMANDS:
    /Remove-DefaultAppAssociations - Removes the default application associations

    from a Windows image.

    /Import-DefaultAppAssociations - Imports a set of default application

    associations to a Windows image.

    /Get-DefaultAppAssociations - Displays the list of default application

    associations from a Windows image.

    /Export-DefaultAppAssociations - Exports the default application associations

    from a running operating system.
    PROVISIONING PACKAGE SERVICING COMMANDS:
    /Get-ProvisioningPackageInfo - Gets the information of provisioning package.

    /Add-ProvisioningPackage - Adds provisioning package.
    APPX SERVICING COMMANDS:
    /Set-ProvisionedAppxDataFile - Places custom data into the specified app

    package (.appx or .appxbundle). The specified

    application package must already be in the image.

    /Remove-ProvisionedAppxPackage - Removes app packages (.appx or .appxbundle)

    from the image. App packages will not be installed

    when new user accounts are created.

    /Add-ProvisionedAppxPackage - Adds app packages (.appx or .appxbundle) to the

    image and sets them to install for each new user.

    /Get-ProvisionedAppxPackages - Displays information about app packages

    (.appx or .appxbundle) in an image that are

    set to install for each new user.
    UNATTEND SERVICING COMMANDS:
    /Apply-Unattend - Applies an unattend file to an image.
    DRIVER SERVICING COMMANDS:
    /Remove-Driver - Removes driver packages from an offline image.

    /Add-Driver - Adds driver packages to an offline image.

    /Get-DriverInfo - Displays information about a specific driver

    in an offline image or a running operating system.

    /Get-Drivers - Displays information about all drivers in

    an offline image or a running operating system.

    /Export-Driver - Export all third-party driver packages from an

    offline image or a running operating system.
    INTERNATIONAL SERVICING COMMANDS:
    /Set-LayeredDriver - Sets keyboard layered driver.

    /Set-UILang - Sets the default system UI language that is used

    in the mounted offline image.

    /Set-UILangFallback - Sets the fallback default language for the system

    UI in the mounted offline image.

    /Set-UserLocale - Sets the user locale in the mounted offline image.

    /Set-SysLocale - Sets the language for non-Unicode programs (also

    called system locale) and font settings in the

    mounted offline image.

    /Set-InputLocale - Sets the input locales and keyboard layouts to

    use in the mounted offline image.

    /Set-TimeZone - Sets the default time zone in the mounted offline

    image.

    /Set-AllIntl - Sets all international settings in the mounted

    offline image.

    /Set-SKUIntlDefaults - Sets all international settings to the default

    values for the specified SKU language in the

    mounted offline image.

    /Gen-LangIni - Generates a new lang.ini file.

    /Set-SetupUILang - Defines the default language that will be used

    by setup.

    /Get-Intl - Displays information about the international

    settings and languages.
    APPLICATION SERVICING COMMANDS:
    /Check-AppPatch - Displays information if the MSP patches are

    applicable to the mounted image.

    /Get-AppPatchInfo - Displays information about installed MSP patches.

    /Get-AppPatches - Displays information about all applied MSP patches

    for all installed applications.

    /Get-AppInfo - Displays information about a specific installed MSI

    application.

    /Get-Apps - Displays information about all installed MSI

    applications.
    PACKAGE SERVICING COMMANDS:
    /Add-Package - Adds packages to the image.

    /Remove-Package - Removes packages from the image.

    /Enable-Feature - Enables a specific feature in the image.

    /Disable-Feature - Disables a specific feature in the image.

    /Get-Packages - Displays information about all packages in

    the image.

    /Get-PackageInfo - Displays information about a specific package.

    /Get-Features - Displays information about all features in

    a package.

    /Get-FeatureInfo - Displays information about a specific feature.

    /Cleanup-Image - Performs cleanup and recovery operations on the

    image.

    /Add-Capability - Add a capability to one image.

    /Remove-Capability - Remove a capability from one image.

    /Get-Capabilities - Get capabilities in the image.

    /Get-CapabilityInfo - Get information of a capability in the image.
    For more information about these servicing commands and their arguments,

    specify a command immediately before /?.
    Examples:

    DISM.exe /Image:C:\test\offline /Apply-Unattend /?

    DISM.exe /Image:C:\test\offline /Get-Features /?

    DISM.exe /Online /Get-Drivers /?
    C:\WINDOWS\system32>Dism /Online/Optimize-Image
    Deployment Image Servicing and Management tool

    Version: 10.0.15063.0

    Error: 87
    The online/optimize-image option is unknown.

    For more information, refer to the help by running DISM.exe /?.
    The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log
    C:\WINDOWS\system32>Dism/Online/Optimize-Image
    Deployment Image Servicing and Management tool

    Version: 10.0.15063.0

    Error: 87
    The online/optimize-image option is unknown.

    For more information, refer to the help by running DISM.exe /?.
    The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log

    C:\WINDOWS\system32>

    The DISM log file ends with an error code 80070057. I have not added it here because of its size. I have run SFC /SCANNOW again, as you can see.
     
    MurrayMuspratt-Rouse, Oct 11, 2017
    #3
  4. Kari Win User

    DISM - Add or Remove Drivers on an Offline Image

    Yes, in answer file.


    That is so obvious, who on earth would think that adding for instance NVidia GPU drivers to media used to install on system with AMD GPU would work?

    Anyway, that is mentioned at the beginning of the tutorial:

    DISM - Add or Remove Drivers on an Offline Image [​IMG]
    Information A default Windows install media is hardware independent, meaning that it can be used to install Windows on any hardware capable of running Windows. Windows will be installed with default drivers, then after the installation Windows Update searches for correct drivers installing them or the user installs drivers manually using ones provided by manufacturer.

    If the install media will be used on specific hardware, you can shorten the time required to install Windows, as well as time required for post install update by adding hardware specific drivers to install media.
     
  5. Jerry06 Win User
    Thanks. Sorry about the second part with the reminder suggestion.
     
    Jerry06, Oct 11, 2017
    #5
  6. DavidY Win User
    Ah I thought you might be doing the DISM/drivers one.

    It is good info and I use parts of this frequently when I'm reinstalling on my old hardware and need to manually add drivers.

    I would suggest DISM /Get-Drivers as an alternate to the Powershell step in 2.2 - the table format is quite useful I find.

    One method of applying the drivers I tried which seems to work (not sure how valid it is) when clean-installing a machine as a one-off:
    • Export drivers as per Step 2
    • Use DISM /Get-Drivers to show which driver is which, and copy only the ones I know are problematic to a subfolder, and add this subfolder to a bootable Windows 10 Setup USB
    • Boot Windows 10 Setup from the USB
    • Open a command prompt with Shift F10, type command 'wpeutil shutdown' but don't press enter. Instead, Alt-Tab back to Setup
    • Follow the normal clean install process, delete partitions and let it install the relevant edition
    • When it says Restarting in a few seconds, quickly Alt-Tab to the command prompt and press enter, to stop it restarting but shut down instead
    • Boot again from the USB, go straight into Shift-F10, and use DISM /add-driver to add relevant drivers to the offline Windows drive as per Step 4
    • wpeutil shutdown again, and let it restart this time, so that Windows boots and finishes configuring itself with the new drivers available to it.
    I found it easier than Mounting the image and also means I don't change the .WIM so I can use that on other hardware without fear of non-standard (and probably quite old) drivers getting in the way .

    Although in some cases I could install and change it once Windows is up and running , one of 1709's default drivers causes a BSOD during installation itself, if I don't add the alternative manually using the above technique before it gets to that point.

    But it's not a technique I've seen anywhere else so I'm probably bending the rules somewhere. *Wink
     
    DavidY, Apr 4, 2018
    #6
Thema:

DISM - Add or Remove Drivers on an Offline Image

Loading...
  1. DISM - Add or Remove Drivers on an Offline Image - Similar Threads - DISM Add Remove

  2. How To Add Drivers And Software In A Offline Windows Image ISO.

    in Windows 10 Drivers and Hardware
    How To Add Drivers And Software In A Offline Windows Image ISO.: How To Add Drivers And Software In A Offline Windows Image ISO? Can I Add It Via DISM? https://answers.microsoft.com/en-us/windows/forum/all/how-to-add-drivers-and-software-in-a-offline/ad15ff72-658d-4a10-b6c9-c26fcbdb7ecc
  3. Windows 10 dism unmount offline image failed with error 32

    in Windows 10 Installation and Upgrade
    Windows 10 dism unmount offline image failed with error 32: Hi thereI am trying to change some registry keys in an offline image BOOT.WIM as to ensure a recovery-media startup uses the right screen resolution.Therefore i use Windows Powershell admin and make some commandline entries.dism /mount-wim /wimfile:G:\SOURCES\BOOT.WIM...
  4. DISM offline source

    in Windows 10 Performance & Maintenance
    DISM offline source: Hi, I have one Win 10 system that's in perfect health, passes sfc & dism with flying colors. I have another Win 10 system, same build as the good one, that has... issues. I'd like to prepare an offline source for DISM from the good system for repairing the bad one. By...
  5. DISM repair corrupt image offline via a DVD, Er 2 ...

    in Windows 10 Support
    DISM repair corrupt image offline via a DVD, Er 2 ...: Hiya all, I am trying to repair an image (corrupt) with DISM using an install.wim. But I keep getting error 2: "Unable to access image." ... check image path and windows directory and have read permissions on folder ... The folder is the temporary folder on X:\windows\temp...
  6. Using DISM to restore offline image

    in Windows 10 Installation and Upgrade
    Using DISM to restore offline image: Hi Microsoft, My windows 10 bootloader is corrupted. I receive errors 0xc0000225 and 0xc0000098 while booting. I have found different methods on internet to fix it but none of it seemed to work. I was trying to repair my image using dism.exe but the problem i am facing...
  7. dism offline repair fails with 'The cleanup-image option is unknown."

    in Windows 10 Updates and Activation
    dism offline repair fails with 'The cleanup-image option is unknown.": Hello I have a laptop that I took the HDD out of and connected it to another Windows 10 machine. I ran the command Dism /Image:e:\ /Cleanup-Image /RestoreHealth but get the error Deployment Image Servicing and Management tool Version: 10.0.10240.16384 Image...
  8. How to Add Driver of an .exe file to an Offline Windows Image

    in Windows 10 Installation and Upgrade
    How to Add Driver of an .exe file to an Offline Windows Image: How to Add Driver of an .exe file to an Offline Windows Image? I know how to of a driver in a compressed file by using DISM but don't know of an Intel (or any company else) driver in form of .exe file 102024
  9. DISM - Edit Registry on an Offline Image

    in Windows 10 Tutorials
    DISM - Edit Registry on an Offline Image: How to: DISM - Edit Registry on an Offline Image [img] Information Servicing an offline image, mounting an image, committing changes, it all sounds a bit complicated to an average Windows user. However, it's just geek speak meaning modifying default Windows install image,...
  10. Dism /Apply-Image and remove the entire content of the directory

    in Windows 10 Support
    Dism /Apply-Image and remove the entire content of the directory: Hi I installed Windows ADK 10 v1511 on Windows 10 v1511 Enterprise 64 bit. I typed the following commands: Code: Dism /Apply-Image /ImageFile:"<wim_File_Path>\install.wim" /Index:1 /ApplyDir:"<Apply_Directory_Path>" /Verify /CheckIntegrity Dism /Capture-Image...

Users found this page by searching for:

  1. dism get driver

    ,
  2. dism App packages (.appx) cannot be serviced on an offline image after a user has logged into the image

    ,
  3. dism add driver image

    ,
  4. dism add driver,
  5. dism remove driver,
  6. dism get drivers unknown,
  7. dism add-driver,
  8. dism mount image,
  9. DISM /image:C:\mount\windows /add-ProvisionedAppxPackage,
  10. dism /online /add-driver,
  11. dism command to add drivers for 32bit operating system,
  12. how to remove driver from mounted image,
  13. nu vot,
  14. dism add-driver online,
  15. remove drivers options is unknown dism