如何确定从批处理文件支行名称 [英] How to determine branch name from batch file
问题描述
我的确从一个TFS获得最新的。
我的本地路径是:
I did a get latest from TFS. My local path is:
C:\\ TFS \\项目\\分支1 \\ CONFIG \\部署\\ CopyInstallers.bat
TFS路径是:
$ \\项目\\分支1 \\ CONFIG \\部署\\ CopyInstallers.bat
CopyInstallers.bat
获得最新的安装文件夹的从服务器上不同的位置分支,拉链他们并把它放在共享位置上的服务器。
CopyInstallers.bat
gets latest of installer folder from the branch at different location on the server and zips them and puts it on the shared location on server.
我有一个名为另一支店2
及其TFS路径是
I have another branch named Branch2
and its TFS path is
$\Project\Branch2\Config\Deployment\CopyInstallers.bat
我试图在尝试使用,以获得分支名 TF.exe
或 TFPT.exe
,所以我不应该哈日code分支名称 CopyInstaller.bat
文件,以获得最新的安装文件夹中。
What I am trying is try to get the branch name using TF.exe
or TFPT.exe
, so that I should not har code the branch name in the CopyInstaller.bat
file to get latest of installer folder.
或者是有任何其他方式,我可以了解,在批处理文件的分支名/路径?
Or is there any other way by which I can get to know the branch name / path with in the batch file?
推荐答案
使用的TF.EXE info命令。
Use the TF.EXE info command.
- 从DOS外壳转到您的工作区所在的目录分支的位置(C:\\ TFS \\项目\\分支1 \\ CONFIG \\部署)
- 使用命令:
TF.EXE信息
- 解析结果的服务器路径:行
编辑:
随着Visual Studio 2010中替换信息
的属性命令
有一个
编辑2
好吧:我给你做一个控制台应用程序,在这里得到了 zip文件,还有的来源$ C $ c和构建EXE。
Ok: I made you a console app, get the zip file here, there's the sources code and build exe.
告诉我,如果这是你所期望的。
Tell me if it's what you expected
这篇关于如何确定从批处理文件支行名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!