I think you should be able to adapt some of the info from this thread on driver detection - Get Driver Information for Video and Audio Drivers
You can restrict the registry queries to the disk device class GUID instead of the video driver class that we were querying at the time, but that should list the expected driver files which you can then look for on the drive.
You can find the devices detected by PnP on the system by querying beneath HKLM\System\CurrentControlSet\Enum\PCI. Storage Controllers should have a ClassGUID of {4d36e96a-e325-11ce-bfc1-08002be10318}. Here’s an excerpt from my machine:
`[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_8086&DEV_8C02&SUBSYS_06221028&REV_05\3&11583659&0&FA]`
"DeviceDesc"="@oem15.inf,%pci\\ven_8086&dev_8c02&cc_0106.devicedesc%;Intel(R) 8 Series/C220 Chipset Family SATA AHCI Controller"
"LocationInformation"="@System32\\drivers\\pci.sys,#65536;PCI bus %1, device %2, function %3;(0,31,2)"
"ClassGUID"="{4d36e96a-e325-11ce-bfc1-08002be10318}"
"ParentIdPrefix"="4&8e33330&0"
"Service"="iaStorA"
"Driver"="{4d36e96a-e325-11ce-bfc1-08002be10318}\\0000"
I think you should be able to query as such:
q: preceding texts of firsts "," of (it as string) of values "LocationInformation" of keys whose (value "ClassGUID" of it as string = "{4d36e96a-e325-11ce-bfc1-08002be10318}") of keys of keys "HKLM\System\CurrentControlSet\Enum\PCI" of native registry
A: @System32\drivers\pci.sys
T: 0.672 ms
I: plural substring
I’ve checked this on exactly 1 model of machine, my home box, so do use with care.
edit Should’ve looked closer, LocationInformation looks like it actually refers to the parent of the device. pci.sys is not the driver for Intel AHCI…