试试这个
set xtxt=xx86
if exist "%windir%\SysWOW64" set xtxt=xx64
set xxa=0
if /i not "%xtxt%"=="xx86" goto hta
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VC\Servicing\8.0>nul && set xxa=1
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VC\Servicing\9.0>nul && set xxa=1
:hta
if /i not "%xtxt%"=="xx64" goto ss
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\VC\Servicing\8.0>nul && set xxa=1
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\VC\Servicing\9.0>nul && set xxa=1
:ss