Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Install software usinf INF file 1

Status
Not open for further replies.

Anesthaesia

Technical User
Aug 30, 2001
126
GB
Hi All,

How can I install/execute an INF file from VB? Since it's not officially an executable, the shell command does not work.

Cheers,
D
 
An INF file is not an executable, so you can't "run" it. It's a text file used by an executable to retrieve settings, etc.

You probably want to run whatever executable uses that INF file.
 
Hi Joe,

There is no executable in the install package - you can also install an INF by right-clicking in Windows Explorer, and selecting the Install option. This is the operation required to install the software I have.
 
OK, I was thinking of an INI file.

INF files are by default associated with setups, but they are sometimes used for other things as well.

When you look at the program associations for INF files
(in File Explorer, Tools -> Folder Options -> File Types tab), you should find the INF extension. Click on it, press Advanced which opens another dialog. There's an Actions list, in which you should see "Install". Select that, then click Edit, which opens another dialog. Under "Application used to perform action" you should see what program is used to run the install. On my system (XP Pro) it is:
C:\WINDOWS\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %1

I'm pretty sure you would replace the %1 with the full path to the INF file.
However, I make no guarantees this will work. I'm just pointing out what I found looking at the file associations. It may be different for different operating systems. But maybe it will give you enough to know where to start looking.

What you need to find out is what executable needs to be run to process the INF file.
 
<I'm pretty sure you would replace the %1 with the full path to the INF file.

That's an old DOS .BAT file convention.

Try creating a batch file. The simple way is to go to the command prompt and do:

[tt] copy con move.bat [/tt]

You'll get a blank cursor, and can begin typing in a text file. Type:

[tt]copy %1 %2
del %1[/tt]

Then type Control-Z. You should see a [tt]^Z[/tt] appear. Hit enter, and you'll get a response that 1 file has been copied. Now, on the command line, type, for example:

[tt]move c:\temp\myfile c:\myfile[/tt]

and you'll find that the two parameters that you've provided are plugged into each %1 and %2 in the batch file.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top