What most people miss is the required /reg:32
to check for the key on Windows x64.
See Microsoft Help article on this subject.
Here is a script that demonstrates how to correctly check for Visual C++ Redistributable for Visual Studio 2012 Update 4.
@ECHO OFF:AuthorREM "CREATED BY WAR59312"REM "FEB 7th 2017"REM Clear ScreenCLSTITLE Detect Visual C++ 2012 RedistributablesREM This Batch Script Detects If Visual C++ Redistributable for Visual Studio 2012 Update 4 Is Installed:DetectWindowsOSREM Are We Running On x86 Or x64IF NOT DEFINED PROCESSOR_ARCHITEW6432 (IF %PROCESSOR_ARCHITECTURE% EQU x86 (REM Windows Is x86GoTo Check32Bit) ELSE (REM Windows Is x64SET NeededFor64BitOnly=/reg:32GoTo Check64Bit)) ELSE (REM Windows Is Unknown But Assume x64 To Be SafeSET NeededFor64BitOnly=/reg:32GoTo Check64Bit):Check64BitREM Checks If Visual C++ 64Bit Redistributable for Visual Studio 2012 Update 4 Is InstalledREG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\x64" /v "Version" %NeededFor64BitOnly% 2>NUL^ | ( FIND "v11.0.61030.00">NUL) && ( ECHO. ECHO 64bit Visual C++ Redistributable for Visual Studio 2012 Update 4 Is Installed ECHO. GoTo Check32Bit) || ( ECHO. ECHO 64bit Visual C++ Redistributable for Visual Studio 2012 Update 4 Is NOT Installed ECHO. GoTo Check32Bit):Check32BitREM Checks If Visual C++ 32Bit Redistributable for Visual Studio 2012 Update 4 Is InstalledREG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\x86" /v "Version" %NeededFor64BitOnly% 2>NUL^ | ( FIND "v11.0.61030.00">NUL) && ( ECHO. ECHO 32bit Visual C++ Redistributable for Visual Studio 2012 Update 4 Is Installed) || ( ECHO. ECHO 32bit Visual C++ Redistributable for Visual Studio 2012 Update 4 Is NOT Installed):ENDECHO.PAUSEEXIT