问题描述
我想编写一个简单的批处理脚本,使用 vcvars32.bat
加载 Visual Studio 构建环境,然后使用 vcbuild
继续构建.但是,我的脚本不会在调用 vcvars32.bat
之后执行.我得到的最后输出是:
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.
如您所见,我使用的是 Visual Studio 2008.这是我最简单的批处理脚本:
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
推荐答案
你必须在你的批处理脚本中使用 call
,否则 vcvars32.bat
的终止将终止你自己的批处理脚本.因此你的脚本应该是:
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
这篇关于如何编写运行 vcvars32.bat 的构建批处理脚本,然后继续构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!