In a previous article we had a look on how to close a specific java process. If you have multiple Java applications opened and start up the Task Manager, you will only see the Java.exe process running, and you cannot know which process belongs to which application. So if you want to terminate the process programmatically it might be a little bit tricky.
In the last article we learned about the Process Explorer, which I’m not going to cover in this article. In this article, we will have a look at a PowerShell script which achieves the same goal as the VBScript.
With PowerShell it’s even easier. The script is as follows:
$CommandLines = Get-CimInstance Win32_Process foreach ($command in $CommandLines) { If ($command.CommandLine -like "*GetInputData*"){ write-host $Command.processId Stop-Process -id $Command.processId } }