Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
strResult = "未安装"
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
Set WshShell = Wscript.CreateObject("Wscript.Shell")

For Each Subkey in arrSubKeys
strDetail = strKeyPath & "\" & SubKey
objReg.EnumValues HKEY_LOCAL_MACHINE, strDetail,arrEntryNames,arrValueTypes
objReg.GetStringValue HKEY_LOCAL_MACHINE, strDetail, "DisplayName", strValue
If Not IsNull(strValue) And StrComp(UCase(strValue), UCase("Microsoft Visual C++ 2005 Redistributable")) = 0  Then
objReg.GetDWORDValue HKEY_LOCAL_MACHINE, strDetail, "Version", dwVersion
If dwVersion >= 134276921 Then
strResult = "已安装"
Exit For 
End If
End If 
Next

if strResult = "未安装"	then
WshShell.run("vcredist_x86.exe")
end if