Installing a driver(.inf) file from command line

2019-03-20 06:06发布

问题:

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...

回答1:

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>



回答2:

There are many variants ... and many complications with newer versions of Windows.

But for starters, try something like this:

rundll32.exe advpack.dll,LaunchINFSectionEx myinf.inf,,c:\temp\mydata.cab,36

  • http://www.msfn.org/board/topic/104891-how-can-i-install-a-inf-file-from-the-command-line/

  • http://msdn.microsoft.com/en-us/library/aa768006%28v=vs.85%29.aspx

  • Programmatic driver install via .inf causing reboot

Note: beware older links that suggest "setupapi" instead of "advpack". You definitely want advpack.dll.