1.

Solve : Value of errorlevel of a batch file in java?

Answer»

How to GET the value of ERRORLEVEL from a batch into java class?

I am RUNNING a batch FILE from java using

Runtime.exec("run.bat");

Now how do i know if the EXECUTION of run.bat was successful or it failed? I thought i can use the value of ERRORLEVEL but I do not know how to get this value in java class.

Any help will be appreciated.

Thanks
JayIf your OS supports it and Java can access the environment variables, you can retrieve and expand the %errorlevel% VARIABLE. I have no idea how to write this however.

Just a thought.



Discussion

No Comment Found