import java.io.*;
public class SysInfo {
public static void main(String[] args) throws Exception
{
Process proc = null;
BufferedReader procStdOut = null;
try
{
// windows 폴더내의 systeminfo 파일을 읽어온다.
proc = Runtime.getRuntime().exec("C:\\WINDOWS\\system32\\systeminfo");
procStdOut = new BufferedReader(new InputStreamReader(proc.getInputStream()));
String line;
while (true)
{
line = procStdOut.readLine();
if (line == null) break;
System.out.println(line);
}
}
catch (Exception e)
{
throw e;
}
finally
{
if (proc != null)
proc.destroy(); // process를 kill시킨다.
if (procStdOut != null)
procStdOut.close();
}
}
}