java执行dos命令学习笔记

单例模式使用例子

/**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException {
        Runtime r = Runtime.getRuntime();           //获取运行时对象
        //r.exec("shutdown -s -t 300");  //关闭
        r.exec("shutdown -a");  //注销
    }

猜你喜欢

转载自blog.51cto.com/357712148/2158214