Monday, 10 April 2017

How to create a backup of drivers using command-line on Windows 10

Here is an easy way to backup and restore device drivers on Windows 10 using the DISM command-line tool.
Whether you’re doing a clean install or reinstalling Windows 10 on your PC, you always need to install those device drivers to enable the operating system to work with the hardware and peripherals.
Nowadays, this is not an issue anymore, as the operating system can detect most of the drivers on your PC automatically. In addition, you can always visit your device manufacturer’s support website to download the latest drivers.

However, there will be times when Windows 10 won’t be able to install certain drivers or your PC manufacturer will stop offering driver for a particular device. Fortunately, the operating system includes a command-line tool to backup every driver currently installed on your PC that you can use before reinstalling Windows 10.

In this guide, you’ll learn the steps to use DISM to create a backup of all the drivers on your PC, and how you can restore them on Windows 10.

How to backup device drivers using DISM

1.      Open File Explorer.
2.      Create a new folder where you want to store the backup with all the drivers.
3.      Open Start do a search for Command Prompt.
4.      Right-click the result and select Run as administrator.
5.      Type the following command and press Enter:
DISM /online /export-driver /destination:C:\DriverBackup

DISM command to export drivers on Windows 10

Note: Change the C:\DriverBackup with the path to the folder where you want to store the backup. If you’re planning to reinstall the operating system, it’s recommended to save the driver backup to an external storage.
Once you completed the steps, DISM will look and make a copy of all the drivers stored in C:\Windows\System32\DriverStore.
It’s important to point out that this method will only make a backup of those .inf drivers. Other drivers installed using an .msi or .exe package won’t get backed up.

How to restore device drivers on Windows 10

According to documentation you should be able to restore drivers on the new installation of Windows 10 using this command: DISM /online /Add-Driver /Driver:D:\DriverBackup /Recurse. However, every time you try the command you’ll get an error: 50 “This command can only be used with an Offline image.”
However, after reinstalling Windows 10, it’s likely that you’ll only need to install a few drivers as the operating system will detect most of them automatically (even without checking for updates), as such you can install the remaining drivers using Device Manager.
To restore drivers manually on Windows 10, do the following:
1.      Use the Windows key + X to open the Power User menu and select Device Manager.
2.      Select and expand the device you want to install the driver. If the device doesn’t currently have any driver installed, it’ll be highlighter as an unknown device.
3.      Right-click the device and select Update Driver Software.

Device Manager update device driver

4.      Click on Browse my computer for driver software.


Device Manager browse backup driver folder

5.      Click the Browse button, locate, and open the folder with backup of all your drivers.
6.      Make sure to check the Include subfolders option.
7.      Click Next to let Windows 10 find and install the correct drivers.

Device Manager restore device driver

  1. Click Close to complete the task.
You can repeat the same steps to install any remaining device without a driver.
While the operating system can detect a number of device drivers, you’ll find this guide particularly useful when Windows 10 can’t detect your network adapter or older devices are no longer supported, but previous drivers still work.

No comments: