Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing a driver(.inf) file from command line

Tags:

I am working in windows 8.1. I need to install a driver file(.inf file) from command line. Which command i need to use.? I know i have many other method for installing a .inf file, but i must install this from command line.

Please help me Thanks in advance...

like image 890
yemans Avatar asked Mar 19 '14 05:03

yemans


People also ask

How do I install a driver from a cat file?

You need to get an Authenticode signature, create a catalog file, and sign it with that. Microsoft decided that, for 64-bit systems, it will require the driver to come untampered from the vendor, by checking it signature. (Note: This is not the same as WHQL, which tests the quality of the driver.

Why can't I install an inf file?

inf drivers that were displaying the inf file you selected does not support this method of installation error by using Device Manager. This might work if the INF driver doesn't have the required install parameters to run conventionally (Right-click > Install) but it's configured to be installed through Device Manager.


2 Answers

Granger's comment works in Windows 7 too. According to MS, PnPUtil (PnPUtil.exe) is included in every version of Windows, starting with Windows Vista.

It is useful for device drivers that do not have default install (right-click "Install" does not work for them).

pnputil -i -a <driverinf>

like image 160
Roland Pihlakas Avatar answered Oct 30 '22 05:10

Roland Pihlakas


The default way for device drivers is:

pnputil -i -a <driverinf>

Legacy Drivers can´t be installed with pnputil and have to use LaunchINFSectionEx-Call

I tested the following and it works with several drivers from Windows 2000 up to Windows 10, 2012R2, 2016, 2019.

rundll32.exe advpack.dll,LaunchINFSectionEx ykmd.inf,Yubico64_Install.NT,,4,N

Pay attention to use the correct section

The correct section of the inf-File must be used, when there is no [DefaultInstall]-Section. This lacks in most answers. Look it up in your drivers inf-File and use the correct section (in my example "Yubico64_Install.NT"). Using the wrong section wont prompt an error. Im my example I use Quiet mode, no UI (4) and Never reboot (N) to install the driver automated via GPO. All options are documented in detail here:

https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa768006(v%3Dvs.85)

like image 34
x0nn Avatar answered Oct 30 '22 07:10

x0nn