使用setupapi.dll安装硬件驱动

格式:

 rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 d:/driver.inf

说明:

(1)DefaultInstall是要安装的段名。假如安装文件inf 如下,则DefaultInstall用“DebugPrint.Install”替代。

[Version]
Signature="$Chicago$"
Class=Unknown
Provider=%PHD%
DriverVer=05/19/1999,1.0.3.0

[Manufacturer]
%PHD% = DebugPrint

[DebugPrint]
%DebugPrint%=DebugPrint.Install, *phdcc/DebugPrint

[DestinationDirs]
DebugPrint.Files.Driver=10,System32/Drivers
DebugPrint.Files.Driver.NTx86=10,System32/Drivers

[SourceDisksNames]
1="PHD DebugPrint Driver disk",,,

[SourceDisksFiles]
DebugPrt.sys=1,obj/i386/free

[SourceDisksFiles.x86]
DebugPrt.sys=1,objfre/i386

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Windows 98

[DebugPrint.Install]
CopyFiles=DebugPrint.Files.Driver
AddReg=DebugPrint.AddReg

[DebugPrint.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,DebugPrt.sys

[DebugPrint.Files.Driver]
DebugPrt.sys

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Windows 2000

[DebugPrint.Install.NTx86]
CopyFiles=DebugPrint.Files.Driver.NTx86
ProfileItems=DebugPrintMonitor

[DebugPrint.Files.Driver.NTx86]
DebugPrt.sys,,,%COPYFLG_NOSKIP%

[DebugPrint.Install.NTx86.Services]
AddService = DebugPrt, %SPSVCINST_ASSOCSERVICE%, DebugPrint.Service

[DebugPrint.Service]
DisplayName    = %DebugPrint.ServiceName%
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_DEMAND_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %10%/System32/Drivers/DebugPrt.sys

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Install DebugPrint Monitor Start Menu link (W2000 only)
[DebugPrintMonitor]
Name=DebugPrintMonitor,FLG_PROFITEM_CURRENTUSER
CmdLine=01,../exe/Release,DebugPrintMonitor.exe

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Strings

[Strings]
PHD="PHD Computer Consultants Ltd"
DebugPrint="DebugPrint driver debugging tool"
DebugPrint.ServiceName="DebugPrint Driver"

SPSVCINST_ASSOCSERVICE=0x00000002 ; Driver service is associated with device being installed
COPYFLG_NOSKIP=2 ; Do not allow user to skip file
SERVICE_KERNEL_DRIVER=1
SERVICE_AUTO_START=2
SERVICE_DEMAND_START=3
SERVICE_ERROR_NORMAL=1

(2)d:/driver.inf是inf文件的全路径。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值