简体   繁体   English

在TFS2015版本中启动.bat

[英]launch a .bat in TFS2015 build

I have a problem trying to launch a server via a .bat file during a TFS build. 我在TFS生成期间尝试通过.bat文件启动服务器时遇到问题。 I usually launch the server via a cmd window and it works fine. 我通常通过cmd窗口启动服务器,并且运行正常。 When I set it in the TFS build, I end up with the following message : 当我在TFS版本中设置它时,最终出现以下消息:

"'..\server_common.bat' is not recognized as an internal command or external, an executable or a command file". 

I also have the following line: 我也有以下一行:

"java   -Dsun.lang.ClassLoader.allowArraySyntax=true  -Xbootclasspath/a:..\..\..\lib\framework\serverjvm15.jar; -cp ..\..\..\lib\framework\fwtime.jar;" indicating a java syntax error (? I'm not skilled in java)

This batch calls other .bat files and sets java VM-related environment variables 该批处理调用其他.bat文件并设置与Java VM相关的环境变量

From my research, it is probably a problem of rights as I don't have admin rights when I use TFS. 根据我的研究,这可能是权限问题,因为使用TFS时我没有管理员权限。 However, all the other steps in the build work fine (installing and launching an appli through command lines, or launching a python script via command lines). 但是,构建中的所有其他步骤都可以正常工作(通过命令行安装和启动appli,或通过命令行启动python脚本)。

However I also tried to launch a basic script with the same kind of step and it works. 但是,我也尝试以相同的步骤启动基本脚本,并且该脚本可以工作。

First, suggest you to follow the tutorial in Batch script . 首先,建议您遵循Batch script中的教程。 Make sure you have meet the requirements of Arguments and used correctly. 确保满足参数要求并正确使用。 Such as

Path 路径

Specify the path to the .bat or .cmd script you want to run. 指定要运行的.bat或.cmd脚本的路径。 The path must be a fully qualified path or a valid path relative to the default working directory. 该路径必须是相对于默认工作目录的标准路径或有效路径 In Team Foundation Build, this directory is $(Build.SourcesDirectory) . 在Team Foundation Build中,此目录为$(Build.SourcesDirectory)

Also RDP to your build agent and use your build service account manually run the server_common.bat to narrow down if the account have enough permission. 另外,RDP还可以传递给您的构建代理,并使用您的构建服务帐户手动运行server_common.bat以缩小该帐户是否具有足够的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM