Caputer a output from .bat file in a java program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shruti Agarwal
    New Member
    • Jan 2012
    • 1

    Caputer a output from .bat file in a java program

    I am executing a batch file and all it does is
    echo Hello World.

    I am exeuting it from a java program using
    Runtime.getRunt ime().exec(cmd .... helloworld.bat) ;

    I want to get the output from echo i.e Hello World in my java program and display it using system.out.prin tln;
    please help
Working...