要通过INF文件安装驱动程序,请右键单击inf文件,然后选择“安装".选项. [英] To install the driver by INF file by right click the inf file and select "install" option.

查看:134
本文介绍了要通过INF文件安装驱动程序,请右键单击inf文件,然后选择“安装".选项.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要右键单击inf文件,然后选择安装"选项以完成许多操作系统的驱动程序安装.我想编写一个简单的实用程序来自动完成这种操作.而且此实用程序需要同时支持32位和64位OS.

以前有没有人做过类似的事情?谁能帮助我详细说明如何制作?如果有任何示例代码将更好并受到赞赏.非常感谢.

I need to right click the inf file and select "install" option to finish the driver installation for many OS. And I would like to program a simple utility to finish this kind of action automatically. And this utility need to support both 32bit and 64bit OS.

Have anyone did similar stuff before? Can anyone help to show me detail how can I make it? If any sample code will be better and appreciated. Thanks a lot.

推荐答案

您可以按照以下步骤抢先一步:

1.运行 procmon [
3.观察procmon中发生的事情.

4.通过以上步骤,您知道Windows的功能,现在您必须从代码中执行此操作.

我从procmon日志中注意到,当我右键单击一个名为test.inf的inf文件并单击install时,资源管理器正在执行此操作:

You could get a head start by following these steps:

1. Run procmon[^] and enable process activity logging.

2. Right click on the inf file of your choice and click install in the context menu.

3. Observe what''s happening in procmon.

4. From the above steps, you know what''s Windows doing, and you now have to do this from your code.

I noticed from the procmon log that explorer is doing this when I right click an inf file called test.inf and click install:

Explorer.exe  ProcessCreate "C:\Windows\System32\InfDefaultInstall.exe"  "C:\Users\Rajesh\SomeLocation\test.inf"



这基本上意味着浏览器正在运行一个名为InfDefaultInstall.exe的可执行文件,并将.inf文件的完整物理路径作为命令行参数传递.
您可以使用
ShellExecute [ CreateProcess [



What this basically means is that explorer is running an executable called InfDefaultInstall.exe, and passing the complete physical path of the .inf file as a command-line parameter.

You could use ShellExecute[^] or CreateProcess[^] to run the InfDefaultInstall.exe process.

Hope that helps.


这篇关于要通过INF文件安装驱动程序,请右键单击inf文件,然后选择“安装".选项.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆