28

I'm trying to enable Intel SRT on my laptop. To do this, I need to change SATA controller mode from AHCI to RAID. The problem is that windows has no drivers for RAID and I can't install it while controller is in AHCI mode.

For now I have RAID driver in INF package (inf, sys, cat files). And I can load Windows recovery console with controller in RAID mode. The last thing to do is to intall this driver, but I don't know how to do it.

Google says rundll32.exe setupapi,InstallHinfSection DefaultInstall 123 <filename>.inf might help, but it doesn't.

Chindraba
  • 2,058

5 Answers5

40

For me pnputil.exe did not do the trick. However, I found the following command, which helped: dism /Image:C:\ /Add-Driver /Driver:D:\ /Recurse. This assumes that your Windows is installed at C:\ and the disk with the driver is present at D:\. This appears to even work, if the disk contains drivers for different architectures (x86 and x64) and operating system versions (XP, 7, ...).

15

use pnputil to add the driver to the driver store. Windows now detects the driver:

pnputil.exe -a C:\<filename>.INF 

And you should add the drivers before changing the mode.

6

The Origin Problem

I encountered an issue where I had a VM (W2k12) on Proxmox and needed more than one driver. However, I didn't know which driver was required, and pnputil was not available for Windows Server 2012 in the recovery console.

The First Solution

drvload drv.inf May work, if you know which driver is the correct one. On a Server might being a Mess and may get frustating!

The Workaround Method

To work around this issue, I used the following solutions:

a. I ran the command for /r %d in (*.inf) do drvload %d. This command searches recursively in the current directory and its subdirectories for all files and loads them as drivers. By doing this, I made sure that all available drivers were loaded into the system.

b. Once the drivers were loaded, I executed the following commands:

These commands assume that the Windows operating system is installed on the C: drive. The pnputil command installs a driver with the specified .inf file using the -i -a options. The dism command, which is used for servicing Windows images, adds a driver from the D: drive to the C: drive using the /Image:C:\ and /Driver:D:\ parameters. The /Recurse option ensures that the command recursively searches for drivers in the specified location.

Additionally, I used the following workaround steps:

cd /D D:
for /r %d in (*.inf) do drvload  %d
for /r %d in (*.inf) do c:\windows\pnputil -i -a %d

In this case, I assumed that the D: drive represented my CDROM/USB drive, and there were .inf files present. These commands changed the directory to the D: drive using cd /D D:, and then, using the for /r loop, iterated through each .inf file. The drvload command was used to install the driver in the recovery, and the c:\windows\pnputil -i -a command installed the driver using the pnputil tool.

The workaround solutions I employed involved recursive searches and executing commands against each driver file found. This enabled the installation of multiple drivers even in cases where the native recursive function was not available, such as in Windows Server 2012.

djdomi
  • 288
2

I had to use a hybrid of the answers already listed here.

First, load the driver to access the target (eg RAID) installation:

drvload driver.inf

Then inject the driver into it:

dism /Image:C:\ /Add-Driver /Driver:D:\ /Recurse

The above assumes that your Windows is installed at C:\ and the disk with the driver is present at D:\

Tom Hale
  • 2,708
1

To add to @devurandom's answer, the following driver servicing commands are available when running something like dism /Image:C:\ /? where C: is your offline Windows install.

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.

If you wanted to REMOVE a bad driver from the driver store, you'd run

X:\>dism /Image:C:\ /Remove-Driver /?

Deployment Image Servicing and Management tool Version: 10.0.26100.1150

Image Version: 10.0.26100.2033

/Remove-Driver /Driver:<path_to_driver.inf>

Removes the specified out-of-box driver from the image. Use /Get-Drivers to see a list of installed drivers. This command is not supported against an online image.

WARNING: Removing a boot-critical driver package can make the offline Windows image unbootable.

Example:
  DISM.exe /Image:C:\test\offline /Remove-Driver /Driver:oem1.inf

In my case, I wanted to remove a bad NVMe driver that I carelessly installed which was preventing Windows from booting with a INACCESSIBLE_BOOT_DEVICE BSOD error. I was pretty sure this driver was to blame since installing it is the last thing I did before the system wouldn't boot.

To list all the 3rd party drivers that are loaded at boot time, from the recovery terminal run:

X:\>dism /Image:C:\ /Get-Drivers

Deployment Image Servicing and Management tool Version: 10.0.26100.1150

Image Version: 10.0.26100.2033

Obtaining list of 3rd party drivers from the driver store...

Driver packages listing:

Published Name : oem0.inf Original File Name : prnms009.inf Inbox : No Class Name : Printer Provider Name : Microsoft Date : 21/06/2006 Version : 10.0.26100.1882

Published Name : oem10.inf Original File Name : smbusamd.inf Inbox : No Class Name : System Provider Name : Advanced Micro Devices, Inc Date : 08/03/2020 Version : 5.12.0.38

...

Published Name : oem18.inf Original File Name : logi_lamparray_usb.inf Inbox : No Class Name : USB Provider Name : Logitech Date : 15/04/2024 Version : 1.1.55.3120

The operation completed successfully.

Assuming you wanted to remove logi_lamparray_usb.inf, you'd run

X:\>dism /Image:C:\ /Remove-Driver /Driver:oem18.inf

And now reboot to Windows.

Vinayak
  • 10,885