通过注册表查询Visual C++ Redistributable Package是否安装

检测Microsoft Visual C++ 2008 Redistributable x64是否安装
通过查询注册表HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall相应项的DisplayName的键值是否有Microsoft Visual C++ 2008 Redistributable - x64。

批处理程序如下:
@ECHO OFF

REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall>NUL 2>NUL && (
  FOR /F %%1 IN ('REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall') DO (
    REG QUERY %%1 /v DisplayName | FINDSTR "Microsoft Visual C++ 2008 Redistributable - x64*" > NUL 2>NUL && (
      ECHO 计算机已经安装 VC++ 2008 Redistributable x64
      GOTO END
    )
  )
)

:END
ECHO 执行完毕
PAUSE>NUL


你可能感兴趣的:(windows开发)