During the setup of a framework with protractor tests, I had a problem. I ad it before, but at that time I did not find a solution. The intention of the framework was to run on our integration server. After each commit of a developer (or me), the tests should run. At this moment they can run after each commit, because it is not taking that long yet. Later it may happen that some tests should run at night or so.
But to perform the integration tests, a backend and some other application should run. Our backend is interacts via html with the user, but also interacts with hardware. The problem was not starting up all this, but tearing down. This because it is legacy code and shutting down is not implemented. This means that the process should be killed by jenkins.
But because our environment uses a lot of batch scripts, jenkins does not halt the backend if a test job is done. This means that I had to create a script to kill the backend after all tests has been running.
I did know how to do that on a unix like environment, but not in a windows environment. And now we are running all our code on windows. A long search later, I found that there is in windows also a command that can kill applications.
taskkill /F /IM backend.exe