格式:
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文件的全路径。