package demo1; import java.io.IOException; public class RunTimeDemo { public static void main(String[] args) throws IOException { Runtime r = Runtime.getRuntime(); //r.exec("shutdown -s -t 300");//300秒后电脑自动关机 r.exec("shutdown -a");//取消关机 } }
package demo1; import java.io.IOException; public class RunTimeDemo { public static void main(String[] args) throws IOException { Runtime r = Runtime.getRuntime(); //r.exec("shutdown -s -t 300");//300秒后电脑自动关机 r.exec("shutdown -a");//取消关机 } }