J#-执行DOS命令

ylbtech_java

package dos;

public class MyDemo
{
    public static void main(String args[])
    {
        try
        {
            Runtime r = Runtime.getRuntime();
            r.exec("cmd.exe /c start dir");
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }
}

 

posted on 2014-07-06 23:44  ylbtech  阅读(111)  评论(0编辑  收藏  举报