日期:2014-05-20 浏览次数:20736 次
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Date; public class Test { public static void main(String[] args){ Process p; String str = new String("d:/start.bat"); try{ p = Runtime.getRuntime().exec(str); InputStream fis=p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); InputStreamReader isr=new InputStreamReader(fis); BufferedReader br1=new BufferedReader(isr); String line=null; while((line=br1.readLine())!=null) { System.out.println(line); } }catch(IOException e){ e.getStackTrace(); } } }