@echo off setlocal EnableExtensions set "VCVARS2019=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\\Build\vcvars32.bat" set "VCVARS=" if exist "%VCVARS2019%" set "VCVARS=%VCVARS2019%" if defined VCVARS goto have_vcvars echo [ERROR] Could not find vcvars32.bat. echo Checked: echo %VCVARS2019% exit /b 1 :have_vcvars call "%VCVARS%" if errorlevel 1 exit /b %ERRORLEVEL% %* exit /b %ERRORLEVEL%