Whenever a specific Windows service fails I want to run a program I’ve created myself. However, I simply can’t find a way to make it fail on purpose, so that I can actually test that everything works correctly.
Note that the service in question is not something I’ve written myself, so I can’t make it fail programmatically from inside the code. I wouldn’t, however, mind writing a program that can make a service fail.
Of course I would prefer just having a “Make service fail” button somewhere in services.msc … 😉
The server I’m doing this on is running Windows Server 2012.
Define “fail”. If you want the process to end, just use pskill or a similar tool that can terminate a process elevated (as an admin).