Automatic installation of driver with Setupapi.dll under WIN2K,XP

Source: Internet
Author: User

Automatic installation of driver with Setupapi.dll under WIN2K,XP

In the drive net see 54cndr write this article, although oneself has been used InstallShield, but still think this is also a very good idea, so excerpt here.

Installing driver with Setupapi.dll

Applicable OS:WIN2K,WINXP

Installshiled Code:

Szprogram = "Rundll32.exe";
szCmdLine = "Setupapi.dll,installhinfsection DefaultInstall" + supportdir + "Netsf.inf";
Launchappandwait (Szprogram, szCmdLine, WAIT);

Attention:

1. Where defaultinstll refers to the installation section in the INF file and must be replaced with the Install section name in its own INF, for example, if the section name is Usbcamera.dev, the code should be changed to:
szCmdLine = "Setupapi.dll,installhinfsection Usbcamera.dev" + supportdir + "Netsf.inf";


2. Supportdir refers to the path of all driver files such as INF and sys. You need to copy all driver files to your hard disk, such as your files in C:yourdriver,
The Supportdir is replaced with "c:////yourdriver////" in the program.  ------------------------------------------------------------------------------------------------------you to command first. DOS command in the environment under the command to debug the success of the program before writing it. This is easy to eliminate errors, note the driver directory and spaces. You can also check the usage of rundll32.exe.

For debugging commands, refer to:

rundll32.exe setupapi.dll,installhinfsection Modem2.nt C://yourdriver//netsf.inf

http://blog.csdn.net/jiangxinyu/article/details/4465445

Automatic installation of driver with Setupapi.dll under WIN2K,XP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.