@Echo off

reg query HKLM\SOFTWARE\Microsoft\NET" "Framework" "Setup\NDP\v4\Full /v Version
if errorlevel 1 (
    reg query HKLM\SOFTWARE\Microsoft\.NETFramework\policy\v4.0 /v 30319
    if errorlevel 1 (
     echo ".NetFramework环境未安装"
     start "" "%CD%\dotNetFx40_Full_x86_x64.exe") else (echo ".NetFramework环境已安装")
) else (echo ".NetFramework环境已安装")


if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="X86" (
   reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0f8bbc41-a65c-4ba1-af69-aacd12d13f5b} /v DisplayName
 if errorlevel 1 (
     echo "VC++2013 x86环境未安装"
     start "" "%CD%\vcredist_2013_x86.exe")  else (echo "VC++2013 x86环境已安装")
) else (
 reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{3838bcad-6df2-4f08-8add-a6217bd229d6} /v DisplayName
 if errorlevel 1 (
     echo "VC++2013 x64环境未安装"
     start "" "%CD%\vcredist_2013_x64.exe")  else (echo "VC++2013 x64环境已安装") 
 reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{0f8bbc41-a65c-4ba1-af69-aacd12d13f5b} /v DisplayName
 if errorlevel 1 (
     echo "VC++2013 x86环境未安装"
     start "" "%CD%\vcredist_2013_x86.exe")  else (echo "VC++2013 x86环境已安装")
)

pause