通过file协议

——————————————————————————————————————————————————————

            URL url = new URL("file:///E:/AutoTest.exe");
            File file1 = Utilities.toFile(url.toURI());
            System.out.println(file1.getAbsolutePath());
            final Process process = Runtime.getRuntime().exec(file1.getAbsolutePath());
            int exitCode = process.waitFor();
            if(exitCode == 0) {
                // 读取结论
                
            }

posted on 2017-09-12 11:00  网络大豆  阅读(205)  评论(0编辑  收藏  举报