如何为Visual Studio命令提示符创建批处理文件 [英] How to create a Batch File for Visual Studio Command Prompt
问题描述
我要为 Visual Studio 2008 x64 Cross Tools命令提示符
创建批处理文件,以便在我的电脑中继续执行操作,这里是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
我可以用简单的命令提示和 MSBuild零件
与Visual Studio命令提示符,但因为这两个提示是不同的,我不能完成我的senario。
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
推荐答案
文件设置VS环境:
call "C:\Program Files\Microsoft Visual Studio 2008\VC\vcvarsall.bat" x86_amd64
svn update
delete some files
MSBuild MySolutiuon.sln
... more commands ...
x86_amd64
是用于x64 Cross Tools命令提示符的参数。
x86_amd64
is the argument used for x64 Cross Tools Command Prompt.
一旦vcvarsall.bat运行,msbuild将在批处理文件中的其余命令的路径中可用。
Once vcvarsall.bat has run, msbuild will be available in the path for the rest of the commands in your batch file.
您不使用Visual C ++,您可能更喜欢使用此行(而不是调用vcvarsall.bat)设置环境:
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):
call %vs90comntools%vsvars64.bat
我现在不在x64机器上,所以文件名就是一个猜测(基于我有vsvars32.bat)。
I'm not on an x64 machine right now, so the file name on that is a guess (based on the vsvars32.bat that I do have).
这篇关于如何为Visual Studio命令提示符创建批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!