Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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"


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.
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900