J
Joe Smith
Hi, group
java 1.4.2, windows xp professional
With test.bat like this:
@echo Hi
@exit -15
I run it with
String execArgs[]={"test.bat"};
Runtime.getRuntime().exec(execArgs[]);
.... Read OutputStream and close
.... Read ErrorStream and close
int code = p.waitFor();
And the returned code is Ok (-15).
Using
@echo Hi
@exit /B -15
The returned code is always 0.
I've tried using
String execArgs[] = {"cmd","/C","test.bat"};
But the result is the same...
Searched in google and in the newsgroup, but I haven't found the reason yet.
Has anybody come accross the same problem?
The real "batch" file is provided by a third company, I don't have the right
to change it, and it's in the second form (with /B).
Thanks!
java 1.4.2, windows xp professional
With test.bat like this:
@echo Hi
@exit -15
I run it with
String execArgs[]={"test.bat"};
Runtime.getRuntime().exec(execArgs[]);
.... Read OutputStream and close
.... Read ErrorStream and close
int code = p.waitFor();
And the returned code is Ok (-15).
Using
@echo Hi
@exit /B -15
The returned code is always 0.
I've tried using
String execArgs[] = {"cmd","/C","test.bat"};
But the result is the same...
Searched in google and in the newsgroup, but I haven't found the reason yet.
Has anybody come accross the same problem?
The real "batch" file is provided by a third company, I don't have the right
to change it, and it's in the second form (with /B).
Thanks!