I have the following problem: I have to get the pid of a running java application. the problem is that I do not directly start the java app, instead I run a bat or exe file which does some other stuff and in the end runs the java app.
In task manager it just shows up as java.exe but there are multiple java applications running on the server and I must find out which one to shut down.
The application opens tcp port 5555. I tryed to use netstat -o which works, but it is too slow! There are many open ports on the server and the netstat takes > 1 minute.
A nother way I could think of was to edit the batch file so that it gets the the pid of the java app when it is started and writes it to a file but II dont know how to get the pid within a batch file.
The server is running server2k3 if that helps any.
thx a ton in advance!