开发者

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();
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜