views:

71

answers:

3

I'm running a test script from batch file.

Because it is test, the programs are expected to fail once in a while. It is file as long as error code is returned so I can continue and mark specific test as failed.

However there is very annoying behavior of executable files under Microsoft Windows - if something fails it pop-ups window like:

This application has failed to start because foo.dll was not found, Re-installing the application may fix the problem

<OK>

Or even better:

The instruction at "..." referenced to memory at "..." ..

Click on OK to terminate the program
Click on CANCEL to debug the program

The result is known - the script execution blocks till somebody presses "Ok" button. And when we talk about automatic scripts that may run automatically at night in some headless virtual machine, it may be very problematic.

Is there a simple way to prevent such behavior and just make an application to exit with failure code - without changing the code of the program itself?

Is this possible at all?