按照以下方式,记住用双斜杠,我的msimn就是一个exe文件import java.lang.*;//包头必须要带
Runtime.getRuntime().exec("d:\\Program Files\\Outlook Express\\msimn");记住要抛出异常

解决方案 »

  1.   

    to:楼上的用反斜杠也可以
    "d:/Program Files/Outlook Express/msimn"
      

  2.   

    class ExecEmo
    {
    public static void main(String[] args)
    {
    Runtime r = Runtime.getRuntime();
    Process p = null;
    try
    {
    p = r.exec("notepad.exe");
    p.waitFor();
    }
    catch (Exception e)
    {
    System.out.println("Error executing notepad");
    }
    System.out.println("Notepad returned " + p.exitValue());
    }
    }
      

  3.   

    请问怎样调用内部命令,如dir,copy等。