In linux I can run:
System.exec('echo test & echo $1');
Which will return the process ID of the command I have executed. How can a similar aproach be translated into Windows? Allowing me to execute a command and return its PID.
Just to be clear I am not looking for the PID of my JAVA application. I am looking for the process ID of an external application spawned by JAVA using System.exec.
Thanks
My Question was not regarding returning the PID of the java process but rather external applications. In the end I had to use C++ to iterate through the system processes sorting by their start time to return the latest process.