0

I have a TFS Build Definition.

In the work flow, I need to bring up a console listener, and run some tests on this listener.

So I create a BAT file with the followings:

start cmd /k "d:\abc.exe"

If I run this BAT file, the BAT itself will terminate, but it will spawn another cmd Windows, running the listener. So all is fine.

But when this is incorporated into TFS Build Definition, the work-flow would wait for the completion of this process, and the entire flow would hang.

I've tried with various switches for both START and CMD so that the work-flow can continue with the listener running, but to no avail.

Suhaib Janjua
  • 3,538
  • 16
  • 59
  • 73
Dunnomuch
  • 223
  • 1
  • 2
  • 11

1 Answers1

0
start "" cmd /c "d:\abc.exe"

in cmd, /k means start a new instance, execute the indicated command and leave the window open. /c means is the same, but when command ends, cmd exits.

MC ND
  • 69,615
  • 8
  • 84
  • 126
  • It's the same. The process abc.exe is started, but TFS work-flow is hung just the same. This process needs to complete, before the work-flow can continue. But if this process completes, it means the listener is no longer running. I am looking for a method to keep this process running while at the same time, the work-flow runs its own course. – Dunnomuch Mar 04 '14 at 07:36
  • @Dunnomuch, I have a doubt. Your work-flow starts a batch file, this batch file spawns a new copy of cmd, in this copy of cmd the abc.exe is started. While it happens, the batch file, after executing the start command, has ended its work and gets closed. How have you defined the test? What is it waiting to end? – MC ND Mar 04 '14 at 07:46
  • Yup. Apparently, If you start a BAT file in the work flow, and that BAT file runs START / CMD, the work flow will wait for all the START / CMD calls to complete before it continues. I actually solve it by having the BAT file calling another EXE instead, and this EXE will call the listener asynchronously. In this way, the listener will be alive, and the work flow continues as normal. Thanks for your response! – Dunnomuch Mar 05 '14 at 07:55