import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Test1 {
public static void main(String args[])
{
try {
Process p = Runtime.getRuntime().exec("cmd ver");
InputStreamReader isr = new InputStreamReader(p.getInputStream());
BufferedReader br = new BufferedReader(isr);
System.out.println(br.readLine());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Excute shell and read the output
最新推荐文章于 2024-06-03 21:28:06 发布