Check for a Windows Program

M

m

Hi All

I have a C++ windows application.

I invoke this C++ app from my java program like this
Runtime.getRuntime().exec("cmd /c p:\\bin\\invokecpp.bat");

Is there a way I can check if my C++ program is up and running from my
java program which invoked it.

Please let me know.

Thanks
 
I

Ike

Try ctl-alt-del, check under the "processes tab." If it is running, you will
see it there. -Ike
 
A

Alex Hunsley

m said:
Hi All

I have a C++ windows application.

I invoke this C++ app from my java program like this
Runtime.getRuntime().exec("cmd /c p:\\bin\\invokecpp.bat");
>
> Is there a way I can check if my C++ program is up and running from my
java program which invoked it.
>
Please let me know.

Please try asking a question if you expect an answer.

http://en.wikipedia.org/wiki/Question_mark
 
W

www

m said:
Hi All

I have a C++ windows application.

I invoke this C++ app from my java program like this
Runtime.getRuntime().exec("cmd /c p:\\bin\\invokecpp.bat");

Is there a way I can check if my C++ program is up and running from my
java program which invoked it.

Please let me know.

Thanks
I guess you want to check if your C++ program has finished or not. You
want to wait until it terminated, then proceed to execute your next Java
code, right ?

Process pr = Runtime.getRuntime().exec("cmd /c p:\\bin\\invokecpp.bat");
//executing the script takes almost no time, but the C++ program
evoked by the script takes some time

pr.waifFor(); //this orders the machine to wait until your C++ program
or any subprocess evoked in last command to finish

System.out.println(pr.exitValue()); //it should print 0 now, which
means your C++ has ended normally
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top