如何成批反注册

来源:百度知道 编辑:UC知道 时间:2024/05/30 14:14:41
我要反注册d:\123文件夹下的所有dll文件 如何一次批量反注册

给你写了个循环,代码如下

Private Sub Command1_Click()
Dim DllFile As String
DllFile = Dir("D:\123\*.dll")
Do While DllFile <> ""
Shell "regsvr32 /u " & DllFile ' /u后面要有个空格
DllFile = Dir
Loop
End Sub

循环查找该目录下所有的dll文件,用filebox可能简单点,加上filter,只列出所有.dll文件

然后挨着反注册

Function refu(a As String)
'a 的格式:"c:\123\*.dll" or "c:\123\*.ocx"
Dim DFile As String
DFile = Dir(a)
Do While DFile <> ""
Shell "regsvr32 /s /u " & DFile
DFile = Dir
Loop
End Function

'使用方法
Private Sub Command1_Click()
refu "c:\1\*.ocx" '批量反注册
End Sub