[Driver Installation] Use setupapi. DLL to automatically install driver in Windows 2 K and XP

Source: Internet
Author: User
Guidance:
Use setupapi. DLL to automatically install driver in Win2k and XP

See54. CNDRAlthough I have always used InstallShield in this article, I think this is also a good idea, so it is excerpted here.

Use setupapi. DLL to install driver

Applicable OS: Win2k, WINXP

Installshiled code:

Szprogram = "rundll32.exe ";
Szcmdline = "setupapi. dll, installhinfsection defaultinstall 132" + suppdir dir + "netsf. inf ";
Launchappandwait (szprogram, szw.line, wait );

Note:

1. defaultinstll refers to the installation section in the INF file and must be replaced with the install section name in the INF file. For example, if the section name is usbcamera. Dev, the code should be changed:
Szcmdline = "setupapi. dll, installhinfsection usbcamera. Dev 132" + supportdir + "netsf. inf ";

2. supportdir refers to the path where all driver files, such as INF and SYS, are located. You must copy all driver files to the hard disk first. For example, if your file is in C: yourdriver,
Supportdir should be replaced with "C: // yourdriver //" in the program ////". in the command doscommand environment, run the command to debug the program. This is easy to troubleshoot. Pay attention to the driver directory and spaces. You can also use rundll32.exe.

For Debugging commands, see:

Rundll32.exe setupapi. dll, installhinfsection modem2.nt 132 C: // yourdriver // netsf. inf

This article is transferred from
Http://www.52rd.com/Blog/Detail_RD.Blog_xjl20008_8591.html

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.