我正在设置CruiseControl.NET。 我遇到的问题是我作为一个控制台应用程序运行CC,当我的构build成功完成并执行(使用exec)时,它会在CruiseControl DOS提示符下启动它。 我只是使用简单的batch file来启动我的应用程序,但让它运行在相同的提示符作为CC导致CC认为构build继续,只要我的应用程序运行。
我认为这工作:
start cmd.exe
start cmd.exe
打开一个单独的窗口
start file.cmd
打开批处理文件并在另一个命令提示符下执行它
这是你需要的代码;)
start cmd.exe @cmd /k "Command"
只需在命令提示符下输入start。
> start
这将打开新的窗口。
START "notepad.exe" echo Will launch the notepad.exe application PAUSE To make any cmd file type all you have to do is save the contents as .bat Ie @echo TITLE example.bat PAUSE taskkill/IM cmd.exe Make that into a "example.bat" file and save it open it and run.
我也尝试在CCNET任务结束时执行运行守护进程/服务器的批处理文件; 使CruiseControl产生独立的异步进程而不等待进程结束的唯一方法是:
使用任务计划程序作为CCNET任务运行批处理文件(使用schtasks.exe)
schtasks.exe /create /F /SC once /ST 08:50 /TN TaskName /TR "c:/path/to/batchFileName.bat"
你可能需要在ccnet开始时杀死进程
PS:所选答案使用“开始cmd.exe”不起作用; 确实会产生一个新的命令提示符,但CCNET将等待产生的cmd完成。
简单的写在你的bat文件中
@cmd
要么
@cmd /k "command1&command2"