找回密码
 加入
搜索
查看: 1706|回复: 1

[系统综合] autoit有没有自带的函数能实现Regsvr32 的功能?能否不用@ComSpec调用CMD的方式 ?

[复制链接]
发表于 2011-2-9 13:36:18 | 显示全部楼层 |阅读模式
Run(@ComSpec & ' /c Regsvr32 /s "ET99_FULL.dll"', "", @SW_HIDE)


autoit有没有自带的函数能实现Regsvr32 的功能??
发表于 2011-2-9 14:01:15 | 显示全部楼层
$sDll = "WSHom.Ocx"

_RegisterServer($sDll)

Func _RegisterServer($sDll)
    Local $fInit, $fError
    Local $aCall = DllCall("ole32.dll", "long", "OleInitialize", "ptr", 0)
    If Not @error Then $fInit = $aCall[0] <> 1 ; The COM library is already initialized
    $aCall = DllCall($sDll, "long", "DllRegisterServer")
    If @error Then $fError = True
    If $fInit Then DllCall("ole32.dll", "none", "OleUninitialize")
    If $fError Then Return SetError(2, 0, False)
    Return SetError($aCall[0] <> 0, $aCall[0], $aCall[0] = 0)
EndFunc
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 13:40 , Processed in 0.075905 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表