[英]open command prompt in hidden mode through java
i want to open command prompt through java and perform some task.我想通过 java 打开命令提示符并执行一些任务。 but i want to open that command prompt in hidden mode.
但我想以隐藏模式打开该命令提示符。
command = "cmd.exe /c start doxygen " + strDoxyfilePath;
Process p=Runtime.getRuntime().exec(command);
Please try following command to start your program minimized请尝试以下命令以最小化启动您的程序
command = "cmd.exe /c start /min doxygen " + strDoxyfilePath;
Process p=Runtime.getRuntime().exec(command);
Try This:尝试这个:
String YourFilePath="c:\....";字符串 YourFilePath="c:\....";
Runtime.getRuntime().exec("cmd.exe /c start /min "+YourFilePath); Runtime.getRuntime().exec("cmd.exe /c start /min "+YourFilePath);
I hope you are looking for this, this will do what you want to do in your above code我希望你正在寻找这个,这将在你上面的代码中做你想做的事情
String strDoxyfilePath = "any path";
String[] Command ={"doxygen",strDoxyfilePath};
try {
Process process = new ProcessBuilder(Command).start();
} catch (IOException e) {
e.printStackTrace();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.