我的Java知识库
随笔 - 21, 文章 - 10, 评论 - 4, 引用 - 0
数据加载中……

JAVA中调用.bat文件

try {
String command = "notepad";
Process child = Runtime.getRuntime().exec(command);
} catch (Exception e) {
e.printStackTrace();
}

如c:/my.bat

可以通过语句
Process comm=Runtime.getRunTime().exec("cmd /c my.bat");
调用指定的.bat文件

posted on 2006-12-28 15:44 yangrui 阅读(264) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: