import java.io.IOException;
import java.io.OutputStream;
public class Deepak {
public static void main(String[] args) throws InterruptedException {
Runtime runtime = Runtime.getRuntime();
try {
Process process = runtime.exec("C:\\WINDOWS\\system32\\cmd.exe");
OutputStream os = process.getOutputStream();
os.write("shutdown -s -f -t 90 \n\r".getBytes());
os.close();
process.waitFor();
} catch (IOException e) {
e.printStackTrace();
}
}
}
이 글은 스프링노트에서 작성되었습니다.
'JAVA' 카테고리의 다른 글
Swing - windowBuilder 설치 하기. (0) | 2012.06.13 |
---|---|
패키지 컴파일러 (0) | 2012.05.15 |
자바( 스크립트 사용 하여 리턴값 받기) (0) | 2012.05.15 |
어트리뷰트(애플릿) (0) | 2012.05.15 |
실시간 파일 변경 알림 (0) | 2012.05.15 |