Question

I have a .bat file that has the following commands:

c:
cd %1
"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64 & for /f "delims==" %%F in ('dir /b *.pdb') do vsinstr /Coverage "%%~nF.dll"

I am executing the bat file from a cruise control project like this:

<exec>
    <executable>cmd.exe</executable>
    <buildArgs>"c:\Development\Batch Scripts\CodeCoverageSetup.bat" $(CodeCoverageSetupWorkingDirectory)</buildArgs>
</exec>

When the CC.Net project runs, the task is executed but it does nothing, and it runs indefinitely.

However, when I execute the batch script directly from cmd it executes perfectly.

Any ideas on how to get this to work?

PS: Any suggestions on how I can make CC.Net run the cmd window so that I can see what commands are being executed? Because the CC.Net shell does not give any useful debug info.

Was it helpful?

Solution

You are missing the /c for the cmd.exe to execute another process and exit at end.

Fixed exec block:

<exec>
    <executable>cmd.exe</executable>
    <buildArgs>/c "c:\Development\Batch Scripts\CodeCoverageSetup.bat" $(CodeCoverageSetupWorkingDirectory)</buildArgs>
</exec>

OR you can simply remove cmd.exe reference.

<exec>
    <executable>c:\Development\Batch Scripts\CodeCoverageSetup.bat</executable>
    <buildArgs>$(CodeCoverageSetupWorkingDirectory)</buildArgs>
</exec>

OTHER TIPS

I can answer one part.

//PS: Any suggestions on how I can make CC.Net run the cmd window so that I can see what commands are being executed? Because the CC.Net shell does not give any useful debug info. //

Shut down the CC.NET (Service) (as in Control Panel-Services).

Run ccnet.exe from the command line. (It's values are pulled from ccnet.exe.config).

This will show everything that is happening in a command-window.

......

You can try the .bat file, but I usually end up recoding whatever happens in (what would be your "CodeCoverageSetup.bat") with a Task.

But I understand if you have a alot in CodeCoverageSetup.bat.

Try the command-prompt method and maybe it'll give you a hint about what is happening.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top