当前位置: 技术问答>java相关
在java application中可以控制一个.exe程序么?
来源: 互联网 发布时间:2015-01-23
本文导语: 我知道在c下面有东西可以控制.exe程序,在java中有啥办法可以控制.exe么?我想应该有可以控制.exe的class吧,谁能告诉我?在java中有可以操作window中的注册表的class么?或者有其他的方法? | ja...
我知道在c下面有东西可以控制.exe程序,在java中有啥办法可以控制.exe么?我想应该有可以控制.exe的class吧,谁能告诉我?在java中有可以操作window中的注册表的class么?或者有其他的方法?
|
java.lang.Runtime.exec
public Process exec(String command)
throws IOException
Executes the specified string command in a separate process.
The command argument is parsed into tokens and then executed as a command in a separate process. The token parsing is done by a StringTokenizer created by the call:
new StringTokenizer(command)
with no further modifications of the character categories. This method has exactly the same effect as exec(command, null).
Parameters:
command - a specified system command.
Returns:
a Process object for managing the subprocess.
Throws:
SecurityException - if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
public Process exec(String command)
throws IOException
Executes the specified string command in a separate process.
The command argument is parsed into tokens and then executed as a command in a separate process. The token parsing is done by a StringTokenizer created by the call:
new StringTokenizer(command)
with no further modifications of the character categories. This method has exactly the same effect as exec(command, null).
Parameters:
command - a specified system command.
Returns:
a Process object for managing the subprocess.
Throws:
SecurityException - if a security manager exists and its checkExec method doesn't allow creation of a subprocess.