i am using Runtime.getRuntime().exec() command in Java to start a batch file which in turn starts another process for windows platform.
javaw.exe(Process1)
|___
An alternative solution, if you control the child process as well as the batch file, would be to have the child process create a thread, open a ServerSocket, listen for a connection to it, and call System.exit() if it receives a correct password on it.
There may be complications if you need multiple simultaneous instances; at that point you would need some way of allocating port numbers to them.