java中调用外部exe文件
2015-09-14 23:55
405 查看
Runtime runtime = new Runtime();
String fileName = "c:\\test.txt";
String commandStr = "rundll32 url.dll,FileProtocolHandler "+fileName;
runtime.exe(commandStr );
或者
Runtime runtime = new Runtime();
String fileName = "c:\\test.txt";
String commandStr = "notePad "+fileName;
runtime.exe(commandStr );
或者
Runtime rt=Runtime.getRuntimee();
rt.exec("C:\\Program Files\\Accessories\\Wordpad D:\\xxxx.txt");
String fileName = "c:\\test.txt";
String commandStr = "rundll32 url.dll,FileProtocolHandler "+fileName;
runtime.exe(commandStr );
或者
Runtime runtime = new Runtime();
String fileName = "c:\\test.txt";
String commandStr = "notePad "+fileName;
runtime.exe(commandStr );
或者
Runtime rt=Runtime.getRuntimee();
rt.exec("C:\\Program Files\\Accessories\\Wordpad D:\\xxxx.txt");
相关文章推荐
- Servlet---JavaWeb技术的核心基础,JavaWeb框架的基石(一)
- Javaweb的基础
- Java中的Enum的使用与分析
- 大文件处理【java以及数据清洗相关】
- java.sql.Types,数据库字段类型,java数据类型的对应关系
- Java虚拟机内存模型
- spring下的子项目
- Spring+Mybatis+mysql配置
- Java设计模式之策略模式
- DOM,JAVA
- java单例设计模式
- 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法
- JAVA 垃圾收集监控
- 使用java的DBUtils
- Eclipse修改workspace
- (1.4.5.1)Java编程题——在一个字符串中查找第一个非重复的字符
- MyBatis+springMVC+easyUI (dataGirl)实现分页(转载)
- JAVA垃圾回收机制
- 【Java大数】hdu 5429 Geometric Progression
- java设计模式第9弹--代理模式