Run dos batch file from macro

Posted by andyg2 on
URL: http://imagej.273.s1.nabble.com/Run-dos-batch-file-from-macro-tp3686469.html

I have a command line OCR app which counts words on a scanned page. How can I:
a) Execute the command line from a macro
b) Wait for execution to end before continuing
c) Read the text output into a variable

I've tried var = Runtime.getRuntime().exec("cmd.exe /c start c:\test.bat"); and a few variations but nothing seems to happen.

I'm very new to Java and batch programming so any help would be much appreciated.