Hello I wrote a script to save all current files to C drive in a folder called DRIVERS for backup or import ...into new installation. figured it would be handy for someone who installs winders alot like me. " ExportDrivers.ps1" save as and run with PS. Code: if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } mkdir C:\Drivers DISM.exe /Online /Export-Driver /Destination:C:\Drivers
Similar to my ghetto compiled one au3 Code: ;;Win10 Dirver Backup #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> #RequireAdmin Sleep(200) Run(@SystemDir & "\system32\WindowsPowerShell\v1.0\powershell.exe") ConsoleWrite(@SystemDir & "\system32\WindowsPowerShell\v1.0\powershell.exe" & @CRLF) Sleep(200) WinWait("Powershell") WinActivate("Powershell") Send("Set-ExecutionPolicy -ExecutionPolicy Unrestricted") Sleep(200) Send("{ENTER}") Sleep(3000) Send("a") Sleep(200) Send("{ENTER}") SplashTextOn("Wait", "Waiting for finish") Sleep(5000) SplashOff() $dPath = DirCreate(@WorkingDir & "\DriverBackup") Send("Export-WindowsDriver -Online -Destination " & $dPath) Sleep(200) Send("{ENTER}")
I think pnputil is the best method, not using dism. No need to mess, exports all drives pnputil /export-driver * C:\Drivers Re install commands Cd C:\Drivers pnputil /add-driver *.inf /install /subdirs