Kill JVM not forcibly from command line in Windows 7
The JVM runs the Cobertura toolbox. When I press Ctrl-C in the Windows console where the application is launched, the JVM ends and Cobertura results are successfully removed to the cobertura.ser file . But I need to stop this JVM with a command / tool (not Ctrl-C), something like "soft kill" in Linux ("kill" command without the "-9" parameter). When I use "taskkill / PID 1234" it writes:
D:\>taskkill /PID 1234
ERROR: The process with PID 1234 could not be terminated.
Reason: This process can only be terminated forcefully (with /F option).
But when I use the / F option, the JVM is forced to quit and so the Cobertura results are not dumped into the cobertura.ser file .
How to kill JVM using windows command line tool / third party tool with successful reset of Cobertura (windows "soft kill")?
source to share
Try looking at WMI using JavaScript or VBScript, you create rules for process selection and kill it.
For example http://community.spiceworks.com/scripts/show/498-kill-a-process-using-wmi - run a simple kill script with VBScript
source to share