简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM