如何用JAVA实现WINDOWS 下的MS-DOS命令 去SUN的JAVA社区上看看吧,我记得以前专门有一个问答系列讲这个的。^_^ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Runtime.getRuntime().exec("cmd /c start dir"); import java.io.*;public class RunText{ public static void main(String[]args) { try { Runtime.getRuntime().exec("cmd /c start dir"); } catch(IOException e) { e.printStackTrace(); } }} String sCmdLine = ""; String sDir = "d:/test" sDir.replace('/',File.separatorChar); Process pr; //Delete all the files in test directory. sCmdLine = "cmd /c del /q " + sDir + File.separatorChar + "*.*"; pr = Runtime.getRuntime().exec(sCmdLine); pr.waitFor(); 同意Runtime.getRuntime().exec("cmd /c start dir"); import java.io.*;public class RunText{ public static void main(String[]args) { try { Runtime.getRuntime().exec("cmd /c start dir"); } catch(IOException e) { e.printStackTrace(); } }}//我觉得这个方法就最好了!简单明了!自己扩充一下就OK了! java中调用子类的小问题,在线等 关于socket 即时响应 求教:什么是java的复合类 如何使上传的图片更清淅 真的是错了! 哪里可以找到像苹果那种风格的java外观包,谢谢 有关Axis 中registerTypeMapping方法的问题 ORACLE里的索引键是怎么一回事?是可以做为主键的自动生成的字段吗?什么数据类型?可以做为主外键吗?急! java可以做能单独执行的exe吗(不要jvm)?? 不能登陆SQL PLUS readline问题? javac 不是内部命令或外部命令,也不是课运行的程序?请帮忙解决一下,在线!
{
public static void main(String[]args)
{
try
{
Runtime.getRuntime().exec("cmd /c start dir");
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
String sDir = "d:/test"
sDir.replace('/',File.separatorChar);
Process pr;
//Delete all the files in test directory.
sCmdLine = "cmd /c del /q " + sDir + File.separatorChar + "*.*";
pr = Runtime.getRuntime().exec(sCmdLine);
pr.waitFor();
Runtime.getRuntime().exec("cmd /c start dir");
{
public static void main(String[]args)
{
try
{
Runtime.getRuntime().exec("cmd /c start dir");
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
//我觉得这个方法就最好了!简单明了!自己扩充一下就OK了!