Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I write a build batch script that runs vcvars32.bat, and then continues with the build?

I want to write a simple batch script that loads the Visual Studio build environment using vcvars32.bat and then continue with the build, using vcbuild. However, my script won't execute past the invocation of vcvars32.bat. The last output I get is:

Setting environment for using Microsoft Visual Studio 2008 x86 tools.

As you can see I'm using Visual Studio 2008. Here is my simplest batch script:

@echo off
"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
vcbuild
like image 282
Jared Oberhaus Avatar asked Apr 17 '09 23:04

Jared Oberhaus


1 Answers

You have to use call in your batch script, or the termination of vcvars32.bat will terminate your own batch script. Therefore your script should be:

@echo off
call "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
vcbuild
like image 175
Jared Oberhaus Avatar answered Nov 08 '22 00:11

Jared Oberhaus