Window batch file terminates prematurely

I have the following batch file

echo Setting  visual studio 2010 environment variables
set VSPATH="C:\Program Files (x86)\Microsoft Visual Studio 10.0"
%VSPATH%\VC\vcvarsall.bat

echo Generating Service

the line "Generating Service" is never printed, can anyone indicate how to do this so that the batch file continues to run?

+3
source share
3 answers

Try using the CALL statement before your batch file.

echo Setting  visual studio 2010 environment variables 
set VSPATH="C:\Program Files (x86)\Microsoft Visual Studio 10.0" 
CALL %VSPATH%\VC\vcvarsall.bat 

echo Generating Service 
+5
source

Prefix start::

echo Setting  visual studio 2010 environment variables
set VSPATH="C:\Program Files (x86)\Microsoft Visual Studio 10.0"
start %VSPATH%\VC\vcvarsall.bat

echo Generating Service
+1
source

use this if you want vcvarsall.bat to run in the current window, rather than a separate one.

Call %VSPATH%\VC\vcvarsall.bat
+1
source

Source: https://habr.com/ru/post/1761954/


All Articles