Home » How To » How to Backup Drivers Using PowerShell Command

How To Backup All Drives in Windows Using PowerShell

Learn how to use PowerShell to quickly and easily back up all the drives in your Windows system to a folder.

On Windows, every hardware device, whether physical or virtual, requires a driver to function properly. A driver helps the Windows operating system communicate with that specific hardware device. As such, we generally install all the required drivers as soon as you install Windows.

However, what if you want to reinstall Windows? Manually reinstalling all the drivers, although easy, is nonetheless a hassle. The good thing is that you can use a simple PowerShell command to back up all the drivers in your system. That way, when needed, you can use another PowerShell command to quickly restore all the drivers. This eliminates the need to manually install drivers one at a time.

In this quick and straightforward guide, let me show you how to back up and restore Windows drivers using PowerShell. Let’s get started.

Before You Start

  • Administrator rights are required to back up drivers using PowerShell.
  • Please create a new folder on a separate drive of your choice, like the D: drive, to store your backup. Avoid using the C: drive.
  • The steps below have been tested to work on Windows 11 and Windows 10.

Steps to Back Up Drivers in Windows Using PowerShell

  1. Right-click the “Windows” icon on the taskbar.
  2. Select the “Terminal (Admin)” or “Windows PowerShell (Admin)” option.
  3. Run the following command in the command-line window.
    Export-WindowsDriver -Online -Destination "D:\path\to\Backup folder"
  4. With that, Windows backs up all the drivers to the provided destination.
  5. You can verify it by opening the backup folder in the File Explorer.

Detailed Steps (With Screenshots)

First, we must open Windows PowerShell with admin rights. To do that, right-click on the “Windows” icon on the taskbar and select the “Terminal (Admin)“. Windows 10 users can select the “Windows PowerShell (Admin)” option.

Once the Terminal or PowerShell window opens, execute the command below. Don’t forget to replace “D:\path\to\Backup folder” between quotes with the actual folder path where you would like to save the driver backup. For example, I’m saving the backup to a folder called “DriverBackup” in the D: drive. So, I replaced the dummy path with D:\DriverBackup.

Export-WindowsDriver -Online -Destination "D:\BackupDestination"
Powershell command to backup drivers 02

After executing a command, Windows PowerShell will scan and back up all the drivers to the provided destination folder. The entire process might take a couple of minutes. Once done, you will see the output something like the image below. Of course, the output will differ depending on the installed drivers on your system.

Powershell command to backup drivers 03

To verify, open the destination folder in the File Explorer, and you will see that Windows has backed up drivers. The good thing is that every device driver is in its own separate folder. So, there will be no confusion in guessing which driver belongs to which device.

Powershell command to backup drivers 04

Good to read: How to disable automatic driver installation in Windows 10.

Restore Drivers Backed Up Using PowerShell

Once you’ve backed up drivers using PowerShell, we’ll use Device Manager to restore drivers as needed. The best thing is, you don’t have to manually select a specific driver to install. Device Manager will take care of it. Here’s how to do it.

  1. Right-click the “Windows” icon on the taskbar.
  2. Select the “Device Manager” option.
  3. Find the device for which you want to install the driver.
  4. Right-click on it and select “Update Driver.”
    Powershell command to backup drivers 06
  5. Select the “Browse my computer for driver software“.
    Powershell command to backup drivers 07
  6. In this window, click the “Browse” button.
    Powershell command to backup drivers 08
  7. The above action will open the Browse window. Here, find the driver backup directory and select it. Remember, just select the root backup directory. There is no need to choose a folder inside the backup folder.
    Powershell command to backup drivers 09
  8. Ensure the “Include Subfolders” checkbox is selected.
  9. Click the “Next” button.
    Powershell command to backup drivers 10
  10. Windows will scan the backup folder, find the relevant driver, and install it.
  11. After installing the driver, Windows will show a confirmation window. Close it.
  12. If necessary, install other drivers in the same process.
  13. Reboot Windows to apply the driver changes.
  14. That’s it. You’ve restored drivers from backup.

As you can see, thanks to a simple PowerShell command, you can easily back up all the drivers on your computer. Once backed up, you can use the Device Manager to just as easily restore the drivers as needed.

If you have any questions or need help, comment below. I’ll be happy to assist.

Good to read:

1 thought on “How To Backup All Drives in Windows Using PowerShell”

Leave a Comment

Your email address will not be published. Required fields are marked *