回复 7# c755731262
用大漠吧,可以在VBS内自注册:完整的程序请参考这里:http://bbs.dp168.com/thread-102239-1-1.html- On Error Resume Next
- .write "'注册大漠<br>"
- Set dm= CreateObject("dm.dmsoft")
- base_path = dm.GetBasePath() '检查是否注册大漠组件dm.dll,以更好支持鼠标、窗口、OCR等功能
- If base_path="" Then
- Mark="" '检查文件是否齐全
- .write progfolder & "\dm.dll"
- if not objFSO.FileExists ("c:\windows\system32\dm.dll") then
- Mark=progfolder
- .write "'复制大漠组件<br>"
- if not objFSO.FileExists (Mark & "\dm.dll") then Mark="k:"
- if not objFSO.FileExists (Mark & "\dm.dll") then msgbox "找不到dm组件,请把大漠组件复制入K盘。":ie.quit:wscript.quit
- objFSO.copyfile Mark & "\dm.dll","c:\windows\system32\","True"
- objFSO.movefile progfolder & "\dm.dll","c:\windows\system32\" '将下面三个文件移动到%ProgramFiles%,system32可能没权限
- if not objFSO.FileExists ("c:\windows\system32\dm.dll") then msgbox ("复制失败")
- .write "'已复制"
- end if
- .write "' 正在注册"
- ws.Run "regsvr32"&" /S "& chr(34) & "dm.dll" & chr(34) '因没有注册大漠组件dm.dll
- .write "重新运行"& chr(34) & Wscript.scriptfullname & chr(34) & "<br>"
- ws.Run "wscript.exe "& chr(34) & Wscript.scriptfullname & chr(34) '重新运行并退出
- objFSO.deleteFile ws.CurrentDirectory & "dm.dll"
- .write "' 注册完成,正在退出"
- wscript.sleep 30000
- ie.quit:wscript.quit
- End If
- On error goto 0
- .write "'大漠组件正常<br>"
- 'ws.CurrentDirectory = progfolder & "\"
- dm.SetPath progfolder & "\"'设programfile文件夹为DM默认工作文件夹
- Set dm= CreateObject("dm.dmsoft")
- base_path = dm.GetBasePath()
- dm.SetPath prog
复制代码
|