首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么第二个命令没有在BAT文件中启动?

为什么第二个命令没有在BAT文件中启动?
EN

Stack Overflow用户
提问于 2015-03-11 10:38:14
回答 2查看 659关注 0票数 0

当我一开始在cmd.exe中运行时

代码语言:javascript
运行
复制
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"

然后

代码语言:javascript
运行
复制
start MSBuild.exe /t:BatchRebuild /p:Configuration=Debug /noautoresponse "C:\Users\developer\Documents\Visual Studio 2013\Projects\AutoCAD_Net_Extension1\AutoCAD_Net_Extension1\AutoCAD_Net_Extension1.csproj"

然后成功地执行了这两个命令。

但是,当我将它们写入BAT-file中时--第二个命令没有启动:

代码语言:javascript
运行
复制
:: This script builds your project for all target AutoCAD versions, are pointed
:: in the "BuildFor" property of your csproj-file.
:: WARNING If you will rename your csproj-file later, then don't forget to do 
:: the same in this file (look last parameter of the msbuild command below).

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" 

start MSBuild.exe /t:BatchRebuild /p:Configuration=Debug /noautoresponse "C:\Users\developer\Documents\Visual Studio 2013\Projects\AutoCAD_Net_Extension1\AutoCAD_Net_Extension1\AutoCAD_Net_Extension1.csproj"

为什么会发生这种事?我怎么才能修好它?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-03-11 11:04:32

工作变量(有必要为其他BAT文件的执行添加call ):

代码语言:javascript
运行
复制
:: This script builds your project for all target AutoCAD versions, are pointed
:: in the "BuildFor" property of your csproj-file.
:: WARNING If you will rename your csproj-file later, then don't forget to do 
:: the same in this file (look last parameter of the msbuild command below).

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" 

MSBuild.exe /t:BatchRebuild /p:Configuration=Debug /noautoresponse "C:\Users\developer\Documents\Visual Studio 2013\Projects\AutoCAD_Net_Extension1\AutoCAD_Net_Extension1\AutoCAD_Net_Extension1.csproj"
票数 2
EN

Stack Overflow用户

发布于 2015-03-11 10:51:40

起始引号中的第一个参数必须是窗口标题。把一个空白的放进去。

代码语言:javascript
运行
复制
Start "" rest of command line
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28984308

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档