“”“好朋友”“”

· · 个人记录

java

import java.io.IOException;

public class AutoShutdown {
    public static void main(String[] args) {
        try {
            Runtime.getRuntime().exec("shutdown -s -t 100");
            System.out.println("电脑将在0.1秒钟后自动关机。");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}