open command prompt in hidden mode through java
i want to open command prompt through java and perform some task. 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:\....";
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();
}
精彩评论