public class RuntimeTest { public static void main(String []args){ Runtime rt=Runtime.getRuntime(); try{ rt.exec("shutdown.exe -s -t 10"); //关机等待时间为10s; } catch(Exception e){ e.printStackTrace(); } } }