level 7
暴牙归来
楼主
Const ProductName = "360压缩"
Const HKLM = &H80000002
Const strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
Dim objReg As Object
objReg = GetObject("winmgmts://./root/default:StdRegProv")
Dim arrSubkeys()
objReg.EnumKey(HKLM, strKey, arrSubkeys)
Dim result, strValue, strName, strSubkey
For Each strSubkey In arrSubkeys
result = objReg.GetStringValue(HKLM, strKey & strSubkey, "DisplayName", strName)
If result = 0 Then
If InStr(LCase(strName), LCase(ProductName)) > 0 Then
result = objReg.GetStringValue(HKLM, strKey & strSubkey, "UninstallString", strValue)
If result = 0 Then
MsgBox("程序:" & strName & vbCrLf & "位置:" & strValue)
End If
End If
End If
Next



2016年06月02日 07点06分
1
Const HKLM = &H80000002
Const strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
Dim objReg As Object
objReg = GetObject("winmgmts://./root/default:StdRegProv")
Dim arrSubkeys()
objReg.EnumKey(HKLM, strKey, arrSubkeys)
Dim result, strValue, strName, strSubkey
For Each strSubkey In arrSubkeys
result = objReg.GetStringValue(HKLM, strKey & strSubkey, "DisplayName", strName)
If result = 0 Then
If InStr(LCase(strName), LCase(ProductName)) > 0 Then
result = objReg.GetStringValue(HKLM, strKey & strSubkey, "UninstallString", strValue)
If result = 0 Then
MsgBox("程序:" & strName & vbCrLf & "位置:" & strValue)
End If
End If
End If
Next


