Start CMD by using ProcessBuilder

To use it with ProcessBuilder you must separate the commands like this:

final List<String> commands = new ArrayList<String>();                

commands.add("cmd.exe");
commands.add("/C");
commands.add("start");
ProcessBuilder pb = new ProcessBuilder(commands);
pb.start();

Leave a Comment

tech