问题描述
实际上我正在工作Wolfram Mathematica
,我们没有任何用于运行外部程序的功能,因此我想使用Java技术来制作此应用程序.
Actually I am working Wolfram Mathematica
,we don't have any functions for running external programs, so I want to do this App using Java technology.
在我的组织中,C
开发团队开发了一个应用程序,并以.exe
格式提供给我们.知道我想从Java
运行该.exe
文件.
In my organization, C
developing team, developed one Application and given to us in a .exe
format.Know I want to run that .exe
file from Java
.
我在C:/Users/Infratab Bangalore/Desktop/Rod's
目录下有一个.exe
名称,称为ThMapInfratab1-2.exe
.
I have a .exe
name as ThMapInfratab1-2.exe
under C:/Users/Infratab Bangalore/Desktop/Rod's
directory.
一旦我们运行.exe
文件,就会自动从同一目录(C:/Users/Infratab Bangalore/Desktop/Rod's
)中将.txt
文件作为输入名称作为TherInput.txt
once we run the .exe
file, automatically I takes .txt
file as a input name as TherInput.txt
from the same directory (C:/Users/Infratab Bangalore/Desktop/Rod's
)
对于我的构想,我以以下方式使用命令提示符手动运行ThMapInfratab1-2.exe
文件.它运行良好.
For my conformation, I run the ThMapInfratab1-2.exe
file manually using command prompt in the following way.it's working great.
C:\Users\Infratab Bangalore\Desktop\Rod's>ThMapInfratab1-2.exe
最后,.exe
文件将t .txt
个文件作为输出导出到同一目录(C:/Users/Infratab Bangalore/Desktop/Rod's
)中.
Finally .exe
file exports t .txt
files as a output into same directory(C:/Users/Infratab Bangalore/Desktop/Rod's
).
同一件事,我想使用Java
做.您能解释一下我的目录吗?
These same thing, I want to do using Java
.can you explain with my directories.
为此,我编写了以下代码,但是它不起作用.
For this, I wrote the following code but it's not working.
import java.io.IOException;
public class ProcessBuilderSample {
public static void main(String args[]) throws IOException {
Process process = new ProcessBuilder(
"C:\\Users\\Infratab bangalore\\Desktop\\Rod's\\ThMapInfratab1-2.exe")
.start();
}
}
如果有人知道,建议我.
If anyone knows,suggest me.
谢谢.
.
推荐答案
Process process=Runtime.getRuntime().exec("C:\Users\Infratab Bangalore\Desktop\Rod's>ThMapInfratab1-2.exe");
这篇关于如何运行.exe文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!