如何为 Visual Studio 命令提示符创建批处理文件
我想为 Visual Studio 2008 x64 交叉工具命令提示符
创建一个批处理文件,以便在我的电脑中连续执行某些操作,以下是情况。
svn update
delete some files
MSBuild MySolutiuon.sln
delete some files
xcopy somefiles
MSBuild AutomateBuildConfiguration.xml /p:Configuration=Release
xcopy some files
delete somefiles
xcopy some files
create a Zip file if it is possible // it is not neccessary
我可以使用简单的命令提示符和 Visual Studio 命令提示符的 MSBuild 部分来完成大部分工作,但是由于这两个提示符不同,我无法完成我的 senario。
我已经测试了所有命令并且对我来说非常有用,如果您知道我应该做什么,请给我一个解决方案。
我检查了这个并且不明白任何东西 先感谢您
I want to create a batch file for Visual Studio 2008 x64 Cross Tools Command Prompt
to do something continuesly in my PC, here is the senario.
svn update
delete some files
MSBuild MySolutiuon.sln
delete some files
xcopy somefiles
MSBuild AutomateBuildConfiguration.xml /p:Configuration=Release
xcopy some files
delete somefiles
xcopy some files
create a Zip file if it is possible // it is not neccessary
I can do most of it with simple Command Prompt and MSBuild parts
with Visual Studio Command Prompt, but as these two prompt are different I cannot complete my senario.
I have tested all command and work great for me, Give me a solution if you know what should I do.
I checked this and didn't underestand anything
Thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
让批处理文件的第一行设置 VS 环境:
x86_amd64
是用于 x64 交叉工具命令提示符的参数。运行 vcvarsall.bat 后,msbuild 将在批处理文件中其余命令的路径中可用。
或者,如果您不使用 Visual C++,您可能更愿意使用此行设置环境(而不是调用 vcvarsall.bat):
For VS 2008:
For VS 2010:
For VS 2012:
For VS 2013:
For VS 2015:
对于 VS 2017:
Batch 现在称为
vc
,而不是vs
。或更好
Make the first line of your batch file set up the VS environment:
x86_amd64
is the argument used for x64 Cross Tools Command Prompt.Once vcvarsall.bat has run, msbuild will be available in the path for the rest of the commands in your batch file.
Alternatively, if you aren't using Visual C++, you might prefer to set up the environment with this line (instead of the call to vcvarsall.bat):
For VS 2008:
For VS 2010:
For VS 2012:
For VS 2013:
For VS 2015:
For VS 2017:
Batch is now called
vc
notvs
.or better
对于 Visual Studio 2015:
对于 Visual Studio 2013:
For Visual Studio 2015:
For Visual Studio 2013:
对于 Visual Studio 2010,这非常有效:
For Visual Studio 2010, this is working great:
对于Visual Studio 2019:
For Visual Studio 2019 :
对于 Visual Studio 2012:
And for Visual Studio 2012:
我按照以下步骤编写了一个bat文件,并且成功了。
I wrote a bat file using the following steps and it worked.
尝试下面的批处理文件来运行 MS 测试/Nunit 测试以进行 C# 测试。
Try below batch file to run the MS test/Nunit test for C# tests.