安装摄像头驱动
已知一个摄像头需要安装驱动,驱动文件也有了如何自动安装 请去看看 帮助里的 安装winzip如果是没有安装程序的 纯驱动 那就 调用 devcon 吧 (xp) 菜鸟站岗,等待老鸟飞过。。。。 EXE文件吗,用/S参数试试,如果是纯驱动试试dpinst.exe搜索试试INF安装驱动。
或者使用自动安装脚本 本帖最后由 Windows8 于 2012-8-10 14:18 编辑
1、提取SYSTEM32的devcon.exe
2、提取纯驱动
3、代码
#Include <File.au3>
Local $123=_FileListToArray(@ScriptDir,"*.inf",1)
For $i=1 To $123
Run(@SystemDir&'\devcon.exe install "'&@ScriptDir&'\'&$123[$i]&'" (你的设备ID,必须有)')
Next
;请将@ScriptDir改为纯驱动的目录。必须保证你的驱动有INF,SYSTEM32必须要有devcon.exe。将“(你的设备ID,必须有)”改为摄像头硬件ID
这是我自己用的一个自动安装INF驱动的脚本,和系统的“添加新硬件向导”一样,只是做成了自动点击
前提是需要有 dpinst.exe, 32位和64位系统用的不一样,上网搜索可分别下载
只需要指定INF文件所在目录即可,不需要提供硬件ID#RequireAdmin
#NoTrayIcon
Local $hWnd
;Local $InstallDir = "F:\Driver\Video\XGI\Windows\xgi_volariz7_11404\2008R2"
;Local $InstallDir = "e:\Driver\Storage\RocketRAID 264x\Windows\Win7_08_08R2_x64"
Local $InstallDir = StringReplace($CmdLineRaw, '"', '')
FileChangeDir(@ScriptDir)
If Not FileExists($InstallDir) Or Not FileExists(@ScriptDir & "\dpinst64.exe") Or Not FileExists(@ScriptDir & "\dpinst32.exe") Then
Exit
EndIf
If @OSArch = "X64" Then
$CommandName = 'dpinst64.exe /LM /F /PATH "' & $InstallDir & '"'
Else
$CommandName = 'dpinst32.exe /LM /F /PATH "' & $InstallDir & '"'
EndIf
$InstallPID = Run($CommandName) ;启动安装程序
If @error Then
Exit
Else
$TimeOut = 100
$Switch = False
While 1
$WinList = WinList("")
For $p = 1 To $WinList
;ToolTip(WinGetProcess($WinList[$p]) &"--"& $InstallPID)
If WinGetProcess($WinList[$p]) = $InstallPID Then
$hWnd = $WinList[$p]
$Switch = True
ExitLoop
EndIf
Next
If $Switch = True Or $TimeOut <= 0 Then ExitLoop ;时间超过10秒还不出现窗口则退出
Sleep(100)
$TimeOut -= 1
WEnd
$Handle = WinGetTitle($hWnd) ;取窗口标题
$Title = "" ;完整窗口标题,用于区分其它窗口
If $Handle <> "" Then
;WinSetTrans($Title, "", 0)
ControlClick($Title, "", "Button2")
While 1
If ControlCommand($Title, "", "Button7", "IsVisible", "") Then
ProcessClose($InstallPID)
Exit
EndIf
If Not ProcessExists($InstallPID) Then Exit
Sleep(500)
WEnd
Else
Exit
EndIf
EndIf
页:
[1]