1

If i am using following command in java:

Process ps = Runtime.getRuntime().exec("some .exe file of VB");

How do I know that the particular .exe has done its job eg: it executed successfully.

How do i know that it has some error or just completed half task in java. How should I design my program in java to know or Is there any way to tell java from VB.

Any help is appreciated.

2 Answers 2

4

I would assume that you could look at the exit status of the program: ps.exitValue() or you could read the stdout/stderr ps.getInputStream() / ps.getErrorStream() respectively.

Sign up to request clarification or add additional context in comments.

2 Comments

+1, Though you MUST read the stdout/stderr; whether you pay attention to it after reading it is up to you :-).
@Mark True, that's a whole other series of SO questions. Thanks for the edit, I didn't read the API close enough.
2

You get back a Process

http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/api/java/lang/Process.html

Which has such methods as:

exitValue() 
getErrorStream() 
waitFor()

Which will get you what you need

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.